Foros de discusión

Determining permissions via roles with AND instead of OR

thumbnail
Bruce Altner, modificado hace 12 años.

Determining permissions via roles with AND instead of OR

New Member Mensajes: 20 Fecha de incorporación: 20/02/09 Mensajes recientes
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
thumbnail
Thiago Leão Moreira, modificado hace 12 años.

RE: Determining permissions via roles with AND instead of OR

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
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:

##
## Permissions
##

    #
    # Set the default permission checker class used by
    # com.liferay.portal.security.permission.PermissionCheckerFactory to check
    # permissions for actions on objects. This class can be overrided with a
    # custom class that implements
    # com.liferay.portal.security.permission.PermissionChecker.
    #
    #permissions.checker=com.liferay.portal.security.permission.SimplePermissionChecker
    permissions.checker=com.liferay.portal.security.permission.AdvancedPermissionChecker

thumbnail
F R, modificado hace 11 años.

RE: Determining permissions via roles with AND instead of OR

New Member Mensaje: 1 Fecha de incorporación: 9/11/12 Mensajes recientes
Hi,

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

Tnx