Foren

How to test permissions of a role

thumbnail
Gurumurthy Godlaveeti, geändert vor 11 Jahren.

How to test permissions of a role

Regular Member Beiträge: 208 Beitrittsdatum: 12.08.11 Neueste Beiträge
Hello All,
I want to test whether role is having the permission to manage users of a particular organization or not? As per this , is there any code?
thumbnail
Rahul Pande, geändert vor 11 Jahren.

RE: How to test permissions of a role

Expert Beiträge: 310 Beitrittsdatum: 07.07.10 Neueste Beiträge
Hi Gurumurthy,

You can use either of the following methods from UserGroupRoleLocalServiceUtil class for this

hasUserGroupRole( { userId } , { groupId of the organization } , { Role name });

hasUserGroupRole({ userId } , { groupId of the organization } , { Role id })

Thanks
Rahul