Fórum

Permission setting at Add Web Content

thumbnail
Balázs Jilling, modificado 13 Anos atrás.

Permission setting at Add Web Content

Junior Member Postagens: 32 Data de Entrada: 18/11/10 Postagens Recentes
Hi,

As I go into the Control Panel, select a community and add a new web content, I select that Anyone (Guest Role) can see the content on the creation page. But after that I can't see it in the corresponding Asset Publisher if I'm watching the site as Guest.

As I go back to the Control Panel, list the web contents, and click on the Actions -> Permissions at the corresponding content, there can be seen that the Guest has no right to view the content. I don't understand this. Isn't the upper setting supposed to set this permission?

Of course after I check the corresponding checkbox, everything works fine. I just don't understand why it doesn't happen at the creation of the web content.

I use Liferay 6.

Thanks,
Balázs
Ramesh Vijayaraghavan, modificado 13 Anos atrás.

RE: Permission setting at Add Web Content

Junior Member Postagens: 49 Data de Entrada: 15/09/10 Postagens Recentes
you can select who has permissions to add content, structure etc on clicking the permissions button but I don't see the view permissions. you probably have to do it at the portlet level on the page.
thumbnail
Balázs Jilling, modificado 13 Anos atrás.

RE: Permission setting at Add Web Content

Junior Member Postagens: 32 Data de Entrada: 18/11/10 Postagens Recentes
I mean the Actions -> Permissions button next to the web content in the Web Content list.
José A. Benítez, modificado 12 Anos atrás.

RE: Permission setting at Add Web Content

New Member Postagens: 20 Data de Entrada: 07/04/11 Postagens Recentes
I have run into the same problem.

When I create I new content from the page view ("Add New" button > "Web Content") and choose the option for permissions Viewable by Anyone (Guest Role), I have no problem at all.

Nevertheless, if I repeat the same process but from Control Panel instead of the page view, the web content VIEW permission for Guest is not set to true, when it should be. If I manually check it works, but I'd rather the visibility was set correctly when it was supposed to be.

Any idea?
José A. Benítez, modificado 12 Anos atrás.

RE: Permission setting at Add Web Content

New Member Postagens: 20 Data de Entrada: 07/04/11 Postagens Recentes
While I was logging in, I remembered I had this unanswered question, that I solved a few days ago, so I just wanted to share the way I solved it.

The option selected for the visibility in the select box is only set (via javascript) once you change its value. By default, the select shows Guest visibility but as it has not changed its value, it will not change the VIEW permission for Guest to true, so when you sumit the form, it will remain unchecked, therefore unVIEWable.

The change I propose is to extend "docroot/html/taglib/ui/input_permissions/page.jsp", modifying this code

<input <%="checked" ? "checked" : "" %> &lt;%= disabled ? "disabled" : "" %&gt;  id="&lt;%= checkboxFieldId %&gt;" name="&lt;%= checkboxFieldName %&gt;" type="checkbox" value="&lt;%= action %&gt;" /&gt;


into this one:

&lt;%
	String valorChecked = "";
	if((action.equals(ActionKeys.VIEW))&amp;&amp; roleName.equals(RoleConstants.GUEST)){
		valorChecked = "checked";
	}
%&gt;
<input <%="checked" ? "checked" : valorChecked %> &lt;%= disabled ? "disabled" : "" %&gt;  id="&lt;%= checkboxFieldId %&gt;" name="&lt;%= checkboxFieldName %&gt;" type="checkbox" value="&lt;%= action %&gt;" /&gt;


This way, the hidden Guest VIEW box will be checked by default, and will change its value only when we change the chosen select option.
thumbnail
Balázs Jilling, modificado 12 Anos atrás.

RE: Permission setting at Add Web Content

Junior Member Postagens: 32 Data de Entrada: 18/11/10 Postagens Recentes
Hi!

Thank you! I will try this way.
thumbnail
Christophe Cariou, modificado 12 Anos atrás.

RE: Permission setting at Add Web Content

Junior Member Postagens: 57 Data de Entrada: 01/10/07 Postagens Recentes
Hi,

I found something strange about permissions on web content creation :

- If I create a web content, from the control panel, inside a community that has a private page layout (at less one empty page), the default view permission is unchecked for guest by defaut.
- If I do the same, inside a community that has no private page layout , the default view permission is checked for guest by defaut.

It has some sense, as when you have a private layout, it means that you want to hide things bye default. But I didn't find any documentation about that rule...
thumbnail
Chris Börgermann, modificado 9 Anos atrás.

RE: Permission setting at Add Web Content

New Member Postagens: 8 Data de Entrada: 03/09/13 Postagens Recentes
Thanks José A. Benítez! That saved my day. The issue is still unresolved in Liferay 6.2.