org.entityfs.util.security
Class AndAccessGranter

java.lang.Object
  extended by org.entityfs.util.security.AndAccessGranter
All Implemented Interfaces:
AccessGranter

public class AndAccessGranter
extends Object
implements AccessGranter

This is an AccessGranter that permits access to an entity if all in a set of access granters do, implementing the logical operation AND.

Instances of this class are immutable (but their wrapped access granters might no be).

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-util

Constructor Summary
AndAccessGranter(AccessGranter... granters)
          Create an AND access granter with the given set of access granters.
 
Method Summary
 boolean hasAccess(Subject s, Permission p)
          Is the subject authorized for the permission?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndAccessGranter

public AndAccessGranter(AccessGranter... granters)
Create an AND 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.
Method Detail

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.