Message Boards

Permissions

Syed Arif, modified 3 Years ago.

Permissions

New Member Posts: 8 Join Date: 10/22/20 Recent Posts

Hi I have created one crud application and i want to give permissions for that like i have created 5 users and 5 roles and i have assigned roles to that 5 users and i want to implement in the code like if user1 login means where he can Add and view ,user2 logins means where he can update ,user3 logins means where he can delete , user4 login means where he can add view update and delete and if user5 login means where he can Add the form.

 

this thing i need to implement in my code?

Syed Arif, modified 3 Years ago.

RE: RE: Permissions

New Member Posts: 8 Join Date: 10/22/20 Recent Posts

Like iam not gettuing exact how if user one login means add entry should come

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Permissions

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

When you define action with respected permision then you can check using PermissionChecker Object whether the current user has requested action permission 

Ex.

PermissionChecker permissionChecker = PermissionThreadLocal.getPermissionChecker();
		permissionChecker.hasPermission(groupId, className, classPK, ActionKeys.ADD_ENTRY)
		


    As in above example it will check whether the user is having permission to add entry for given className and classPK