Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Peter Warrick
Check Other User's Permissions?
November 27, 2012 1:09 AM
Answer

Peter Warrick

Rank: New Member

Posts: 20

Join Date: September 25, 2012

Recent Posts

I'm looking to check whether another user has permissions to view an MBMessage in a hook I've made...

I have the following...

boolean hasPerm = PermissionLocalServiceUtil.hasUserPermission (otherUser.getUserId (), ActionKeys.VIEW, message.getPrimaryKey ());

But it always returns false even though I know that "otherUser" has permission to view that message.

Any pointers?

Regards,

Peter
Juhi Kumari
RE: Check Other User's Permissions?
November 27, 2012 3:14 AM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi Peter,

Try this
1boolean hasPerm = MBMessagePermission.contains(permissionChecker, message, ActionKeys.VIEW);


Regards
Juhi