Hello,
I am using Liferay EE 6.1.20 and I've been unsuccessfully trying to understand how to use
PermissionServiceUtil's hasUserPermissions method:
1 static boolean hasUserPermission(long userId, String actionId, long resourceId)
I understand what userId means, actionId I assume is one of the ActionKeys enum value (like ActionKeys.UPDATE) but what is resourceId?
I know that in Liferay everything from portlet to blog to message board is a resource. Specifically I want to check Update permissions on a layout. I looked in the Resource_ table in the database and found that it is empty. There are rows in the ResourceAction and ResourcePermission tables but I don't see a resourceId column in them.
My question is how can I use hasUserPermission in order to find out if a user has update permission on a layout? The reason I'm interested in this method is because I hope that if I understand how to use it I could also use this method which receives a list or resources in order to check user permissions for several layouts, not just one:
1static boolean hasUserPermissions(long userId, long groupId, List<Resource> resources, String actionId, PermissionCheckerBag permissionCheckerBag)
Please advise,
Thanks
Please sign in to flag this as inappropriate.