org.entityfs
Class DisabledAccessController

java.lang.Object
  extended by org.entityfs.AbstractAccessController
      extended by org.entityfs.DisabledAccessController
All Implemented Interfaces:
AccessController

public final class DisabledAccessController
extends AbstractAccessController

The DisabledAccessController is used to disable access controls altogether in a file system.

Instances of this class do not have any internal state. Use the singleton instance INSTANCE instead of instantiating the class.

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

Field Summary
static DisabledAccessController INSTANCE
          Singleton instance.
 
Method Summary
 void checkPermission(Permission p)
          Verify that the current Subject is authorized for the permission.
 boolean hasPermission(Permission p)
          Does the current Subject have the permission? It is up to the access controller implementation to know how to find the current subject.
 boolean isEnabled()
          Check if the AccessController is enabled.
 
Methods inherited from class org.entityfs.AbstractAccessController
getLockCommandsForAccessControl, getSubject, setSubject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DisabledAccessController INSTANCE
Singleton instance.

Method Detail

isEnabled

public boolean isEnabled()
Description copied from interface: AccessController
Check if the AccessController is enabled. A disabled access controller grants all access requests.

Returns:
false, always.

hasPermission

public boolean hasPermission(Permission p)
Description copied from interface: AccessController
Does the current Subject have the permission? It is up to the access controller implementation to know how to find the current subject. Most implementations will use some kind of ThreadLocal to store the subject.

The AccessController.checkPermission(Permission) method performs the same checks as this method, but throws an AccessDeniedException if the subject does not have the requested permission.

Parameters:
p - The permission. When EntityFS methods are calling this method, this is always an EntityPermission.
Returns:
true if the subject has the permission, false if not.
See Also:
AccessController.checkPermission(Permission)

checkPermission

public void checkPermission(Permission p)
Description copied from interface: AccessController
Verify that the current Subject is authorized for the permission.

The AccessController.hasPermission(Permission) method performs the same checks as this method, but returns false instead of throwing an exception if the subject does not have the requested permission.

Specified by:
checkPermission in interface AccessController
Overrides:
checkPermission in class AbstractAccessController
Parameters:
p - The permission. When EntityFS methods are calling this method, this is always an EntityPermission.
See Also:
AccessController.hasPermission(Permission), AccessController.getLockCommandsForAccessControl(Entity)