Foros de discusión

How to test permissions of a role

thumbnail
Gurumurthy Godlaveeti, modificado hace 11 años.

How to test permissions of a role

Regular Member Mensajes: 208 Fecha de incorporación: 12/08/11 Mensajes recientes
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, modificado hace 11 años.

RE: How to test permissions of a role

Expert Mensajes: 310 Fecha de incorporación: 7/07/10 Mensajes recientes
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