Reputation: 1304
In Liferay when a page is added to the Site it by default gives VIEW
permission to the Guest role.
Is there any way (either through configuration or through hook or other) to disable this so that by default VIEW
permission is disabled for Guest role when a new page is added to the Site?
Upvotes: 3
Views: 4049
Reputation: 1304
There are ways (through liferay Configuration and Ext) with which you can restrict VIEW of Site public pages for those Users who don't explicitly have that permission.
1st Approach
So this can be achieved by setting this property to false
in portal-ext.properties:
permissions.check.guest.enabled=false
But by setting this property what will happen is that Guest role would make sense only for Users who have not logged-in, once the User logs-in even if there is a VIEW permission on Guest for a page or asset the User won't be able to view it unless the User has that permission.
So Guest role would be rendered completely useless even if you give all the permissions to Guest role.
For users who have not logged-in, you can send them to login page with some logic.
2nd approach
1) Updating site.xml in EXT-plugin to disable default VIEW
permissions for guest while adding Site pages.
By doing so when site page is added, by default Guest role's view permission is unchecked.
Upvotes: 5
Reputation: 4210
Well, while page [Layout-in Liferay low level context] is added as Public page, Liferay assigns default permissions to GUEST
role defined in sites.xml
for Layout model.
Basically there are two ways to avoid it through ext development:
sites.xml
LayoutLocalServiceImpl
in ext by over-riding addLayout
method by having addGroupPermissions
boolean value as false
.Upvotes: 5