Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Bruce Altner
Determining permissions via roles with AND instead of OR
August 4, 2011 5:09 AM
Answer

Bruce Altner

Rank: New Member

Posts: 20

Join Date: February 20, 2009

Recent Posts

Greetings:

I have a use case that would require me to set permissions to view artifacts based on combined roles. That is, if someone has Role A AND Role B and each role contained the view permission then they could see the artifact, but not if they had only one or the other role but not both. I may need to extend this to more than two roles as well. Does Liferay provide a means for doing this? As of right now the only solution I see is to make a combined role, called, say, Role A&B, but that starts to get unwieldy as the number of roles that you have to combine in this way increases as sum(i=0,N-1)2^i. That would mean 3 unique roles for A,B (A, B, and A&B ) but 7 unique roles for A,B,C (A, B,C, A&B, A&C, B&C, A&B&C) and so on. Not a good solution.

Thanks,
Bruce
Thiago Leão Moreira
RE: Determining permissions via roles with AND instead of OR
August 1, 2011 3:04 PM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1365

Join Date: October 10, 2007

Recent Posts

Liferay does not support this by default. You must implement your customized PermissionChecker to allow Liferay to do this. Check the following properties for further information:

 1##
 2## Permissions
 3##
 4
 5    #
 6    # Set the default permission checker class used by
 7    # com.liferay.portal.security.permission.PermissionCheckerFactory to check
 8    # permissions for actions on objects. This class can be overrided with a
 9    # custom class that implements
10    # com.liferay.portal.security.permission.PermissionChecker.
11    #
12    #permissions.checker=com.liferay.portal.security.permission.SimplePermissionChecker
13    permissions.checker=com.liferay.portal.security.permission.AdvancedPermissionChecker
Francesco R
RE: Determining permissions via roles with AND instead of OR
November 9, 2012 8:10 AM
Answer

Francesco R

Rank: New Member

Posts: 1

Join Date: November 9, 2012

Recent Posts

Hi,

I have the same requirement.
Now with Liferay 6 (CE or EE) is it possible?

Tnx