org.entityfs.util.security
Class OrAccessGranter
java.lang.Object
org.entityfs.util.security.OrAccessGranter
- All Implemented Interfaces:
- AccessGranter
public class OrAccessGranter
- extends Object
- implements AccessGranter
This is an AccessGranter
that permits access to an entity if any in a
set of access granters do, implementing the logical operation OR
.
Instances of this class are immutable (but their wrapped access granters
might no be).
- Since:
- 1.0
- Author:
- Karl Gustafsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OrAccessGranter
public OrAccessGranter(AccessGranter... granters)
- Create an
OR
access granter with the given set of access
granters. If the set is empty, this access granter will permit all kinds
of access to all entities.
- Parameters:
granters
- The access granters.
hasAccess
public boolean hasAccess(Subject s,
Permission p)
- Description copied from interface:
AccessGranter
- Is the subject authorized for the permission?
- Specified by:
hasAccess
in interface AccessGranter
- Parameters:
s
- The subject. Might be null
.p
- The permission.
- Returns:
true
if the subject is authorized for the permission,
false
if not.