Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Yves LeGrand
How to set Layout Permissions
February 21, 2012 7:06 AM
Answer

Yves LeGrand

Rank: Regular Member

Posts: 158

Join Date: November 18, 2009

Recent Posts

Hi Liferay.

Actually i am struggling with this little problem emoticon:

How one can set the permissions for a certain layout, maybe a layout within a site which is called "page1"?
I will have to create a new role "page1admin" which should be available on the layout permission dialogue and which should have the correct permissions set without user interaction. So this role should have the permissions to update the page ... . How can i set these permissions on this page programmatically?

Can someone post a piece of code which could clearify this?

Thanks a lot.

Best regards,
Yves
Oliver Bayer
RE: How to set Layout Permissions
February 21, 2012 7:41 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 881

Join Date: February 18, 2009

Recent Posts

Hi Yves,

afaik you can only set permission portal wide or community/website wide but not on a page level for a giveen role. You can try grouping the pages in another way so that one role is allowed to modify all pages in a website (at least in my use-cases it worked that way).

HTH Oli
Yves LeGrand
RE: How to set Layout Permissions
February 22, 2012 4:27 AM
Answer

Yves LeGrand

Rank: Regular Member

Posts: 158

Join Date: November 18, 2009

Recent Posts

Hi again.

As far as i can see, you can set the "View"-Permission of a certain Layout according to different Roles:
Guest, Owner, Power User, ...

Per default the "View"-Permission for the role Guest is set to true for new added page in the public pages.
I need to reset these Permissions for the roles. For example I need to set false for guest for a new added page.

So can someone help me with this?

Thanks a lot,
Yves
Oliver Bayer
RE: How to set Layout Permissions
February 23, 2012 5:25 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 881

Join Date: February 18, 2009

Recent Posts

Hi,

the easiest solution would be to switch to private pages where the guest users don't have view permissions already by default. Otherwise I think you have to modify the "portal-impl \ resource-actions \ sites.xml" and remove the VIEW action-key from the guest-defaults of the layout model resource. But this change will only apply for newly created pages, for each existing page you have to remove the guest-view-permission manually.

Greets Oli