org.entityfs.util.security
Class NotAccessGranter

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

public class NotAccessGranter
extends Object
implements AccessGranter

This is an AccessGranter that reverses the decisions of another AccessGranter, implementing the logical operation NOT.

Instances of this class are immutable (but the wrapped AccessGranter may not be).

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

Constructor Summary
NotAccessGranter(AccessGranter negated)
          Create a reversing access granter.
 
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

NotAccessGranter

public NotAccessGranter(AccessGranter negated)
Create a reversing access granter.

Parameters:
negated - The access granter whose decisions should be reversed.
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.