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 Panel → Portal Settings → Users, here we can specify which Roles, Sites or UserGroups can be assigned to the User when the User is created.
To elaborate:
Champion
RolePage1
, Page2
etc) or private pages in a Site, say Site01
.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
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 Panel → Portal → Roles → ChampionRole → Define Permissions → Sites, 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:
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