dbXML API

com.dbxml.db.core.security
Interface SecurityManager

All Superinterfaces:
Configurable
All Known Implementing Classes:
SecurityManagerBase

public interface SecurityManager
extends Configurable

SecurityManager manages Users, Roles, and Access Control Lists for dbXML.


Method Summary
 void access(java.lang.String path, int mask)
          access performs an access control check against the SecurityManager's access control lists.
 void authenticate(java.lang.String userID, java.lang.String password)
          authenticate checks a User against the SecurityManager's access control lists.
 java.lang.String getCurrentUserID()
          getCurrentUserID returns the currently authenticated User ID.
 void setDatabase(Database database)
          setDatabase sets the Database instance for this SecurityManager.
 void setMagicUser(User magicUser)
          setMagicUser sets the User instance that the SecurityManager can use to represent system-level credentials for low level resource access.
 void setUserStack(UserStack userStack)
          setUserStack sets the User stack for the SecurityManager.
 
Methods inherited from interface com.dbxml.util.Configurable
getConfig, setConfig
 

Method Detail

setDatabase

public void setDatabase(Database database)
setDatabase sets the Database instance for this SecurityManager. It is the Database that the SecurityManager will be assigned to protect. It should also be the Database that the SecurityManager uses to manage access control lists (if local).


setUserStack

public void setUserStack(UserStack userStack)
                  throws SecurityException
setUserStack sets the User stack for the SecurityManager.

Parameters:
userStack - The UserStack
Throws:
SecurityException

setMagicUser

public void setMagicUser(User magicUser)
                  throws SecurityException
setMagicUser sets the User instance that the SecurityManager can use to represent system-level credentials for low level resource access. The implementation of this method should not be allowed to overwrite an existing value, as the Database will call this method only one time.

Parameters:
magicUser - The magic User
Throws:
SecurityException

authenticate

public void authenticate(java.lang.String userID,
                         java.lang.String password)
                  throws SecurityException
authenticate checks a User against the SecurityManager's access control lists. If the user ID and password do not check out, a SecurityException is thrown.

Parameters:
userID - the User ID to check
password - the Password to check
Throws:
SecurityException

access

public void access(java.lang.String path,
                   int mask)
            throws SecurityException
access performs an access control check against the SecurityManager's access control lists. If the current user isn't allowed to access the specified path with the defined permission mask, a SecurityException is thrown.

Parameters:
path - the resource path being accessed
mask - The access mask to check against
Throws:
SecurityException

getCurrentUserID

public java.lang.String getCurrentUserID()
getCurrentUserID returns the currently authenticated User ID.

Returns:
The current User ID

dbXML API

Copyright (c) 2004 The dbXML Group