org.apache.jackrabbit.core.security
Class SimpleJBossAccessManager

java.lang.Object
  extended by org.apache.jackrabbit.core.security.SimpleJBossAccessManager
All Implemented Interfaces:
AccessManager

public class SimpleJBossAccessManager
extends Object
implements AccessManager

The simple JBoss access manager is a specialized Access Manager to handle Authorization of individuals authenticated through JBoss login modules. It maps roles from the JBoss simplegroup class to Jackrabbit permissions.

Author:
dhartford
See Also:
http://wiki.apache.org/jackrabbit/SimpleJbossAccessManager

Field Summary
protected  boolean anonymous
           
protected  boolean system
           
 
Fields inherited from interface org.apache.jackrabbit.core.security.AccessManager
READ, REMOVE, WRITE
 
Constructor Summary
SimpleJBossAccessManager()
           
 
Method Summary
 boolean canAccess(String workspaceName)
          Determines whether the subject of the current context is granted access to the given workspace.
 void checkPermission(ItemId id, int permissions)
          Determines whether the specified permissions are granted on the item with the specified id (i.e.
 void close()
          Close this access manager.
 void init(AMContext context)
          Initialize this access manager.
 boolean isGranted(ItemId id, int permissions)
          Determines whether the specified permissions are granted on the item with the specified id (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

system

protected boolean system

anonymous

protected boolean anonymous
Constructor Detail

SimpleJBossAccessManager

public SimpleJBossAccessManager()
Method Detail

init

public void init(AMContext context)
          throws AccessDeniedException,
                 Exception
Description copied from interface: AccessManager
Initialize this access manager. An AccessDeniedException will be thrown if the subject of the given context is not granted access to the specified workspace.

Specified by:
init in interface AccessManager
Parameters:
context - access manager context
Throws:
AccessDeniedException - if the subject is not granted access to the specified workspace.
Exception - if another error occurs

close

public void close()
Description copied from interface: AccessManager
Close this access manager. After having closed an access manager, further operations on this object are treated as illegal and throw

Specified by:
close in interface AccessManager

checkPermission

public void checkPermission(ItemId id,
                            int permissions)
                     throws AccessDeniedException
Description copied from interface: AccessManager
Determines whether the specified permissions are granted on the item with the specified id (i.e. the target item).

Specified by:
checkPermission in interface AccessManager
Parameters:
id - the id of the target item
permissions - A combination of one or more of the following constants encoded as a bitmask value:
  • READ
  • WRITE
  • REMOVE
Throws:
AccessDeniedException - if permission is denied

isGranted

public boolean isGranted(ItemId id,
                         int permissions)
Description copied from interface: AccessManager
Determines whether the specified permissions are granted on the item with the specified id (i.e. the target item).

Specified by:
isGranted in interface AccessManager
Parameters:
id - the id of the target item
permissions - A combination of one or more of the following constants encoded as a bitmask value:
  • READ
  • WRITE
  • REMOVE
Returns:
true if permission is granted; otherwise false

canAccess

public boolean canAccess(String workspaceName)
Description copied from interface: AccessManager
Determines whether the subject of the current context is granted access to the given workspace.

Specified by:
canAccess in interface AccessManager
Parameters:
workspaceName - name of workspace
Returns:
true if the subject of the current context is granted access to the given workspace; otherwise false.


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.