Question

Is there some configuration where we can provide default Permissions for a Site page for a particular Role?

Similar to the functionality we have in Control PanelPortal SettingsUsers, here we can specify which Roles, Sites or UserGroups can be assigned to the User when the User is created.

To elaborate:

  1. I have created a new Role say, Champion Role
  2. Now I am creating public pages (Page1, Page2 etc) or private pages in a Site, say Site01.
  3. I require that when the Page1 was created in Site01 then the VIEW & UPDATE permission should be automatically assigned to Champion Role.

I know this is possible through a listener hook by having a LayoutListener and overriding various methods, but I am looking for another easier or cleaner solution.

Thanks

Was it helpful?

Solution

I think you could and should do it by using the Liferay's Permission management system, and you should avoid extending code to do your task

Go to Control PanelPortalRolesChampionRoleDefine PermissionsSites, then go to the Site actions subgroup and check the VIEW and UPDATE, then use the Limit Scope link, where you'll select the site:

enter image description here

After that, all you have to do is give this role to the right people, e.g like directly applying the Champion Role as a personal role to specific users, by the control panel

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top