org.mmbase.security.implementation.context
Class ContextAuthorization

java.lang.Object
  |
  +--org.mmbase.security.Authorization
        |
        +--org.mmbase.security.implementation.context.ContextAuthorization

public class ContextAuthorization
extends Authorization

authorization based on a config


Fields inherited from class org.mmbase.security.Authorization
configFile, fileWatcher, manager
 
Constructor Summary
ContextAuthorization()
           
 
Method Summary
 void assert(UserContext user, int nodeNumber, Operation operation)
          This method could be overrided by an extending class.
 boolean check(UserContext user, int nodeNumber, Operation operation)
          This method could be overrided by an extending class.
 void create(UserContext user, int nodeNumber)
          This method could be overrided by an extending class.
 java.lang.String getContext(UserContext user, int nodeNumber)
          This method could be overrided by an extending class.
 java.util.HashSet getPossibleContexts(UserContext user, int nodeNumber)
          This method could be overrided by an extending class.
protected  void load()
          This method could be overrided by an extending class.
 void remove(UserContext user, int nodeNumber)
          This method could be overrided by an extending class.
 void setContext(UserContext user, int nodeNumber, java.lang.String context)
          This method could be overrided by an extending class.
 void update(UserContext user, int nodeNumber)
          This method could be overrided by an extending class.
 
Methods inherited from class org.mmbase.security.Authorization
load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextAuthorization

public ContextAuthorization()
Method Detail

load

protected void load()
Description copied from class: Authorization
This method could be overrided by an extending class. It should set the settings for this class, and when needed retrieve them from the file at location configPath.
Overrides:
load in class Authorization

create

public void create(UserContext user,
                   int nodeNumber)
            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. It has to be called, when a new Node has been created. This way, the authentication can create default rights for this object, depending on the UserContext and generate logging information.
Overrides:
create in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has just been added to the MMBase cloud.

update

public void update(UserContext user,
                   int nodeNumber)
            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. It has to be called, when a Node has been changed. This way, the authentication can generate log information for this object, which can be used for accountability
Overrides:
update in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has just been changed in the cloud.

remove

public void remove(UserContext user,
                   int nodeNumber)
            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. It has to be called, when a Node has been removed from the cloud. This way, the authentication can generate log information for this node, and remove the authorization object which belongs to this node.
Overrides:
remove in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has just been removed in the cloud.

setContext

public void setContext(UserContext user,
                       int nodeNumber,
                       java.lang.String context)
                throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method changes the rights on a node, by telling the authorization that it should use the context which is defined.
Overrides:
setContext in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has to be asserted.
context - The context which rights the node will get
Throws:
org.mmbase.SecurityException - If operation is not allowed
org.mmbase.SecurityException - If context is not known

getContext

public java.lang.String getContext(UserContext user,
                                   int nodeNumber)
                            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method returns the context of a specific node.
Overrides:
getContext in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has to be asserted.
Returns:
the context setting of the node.
Throws:
org.mmbase.SecurityException - If operation is not allowed(needs read rights)

getPossibleContexts

public java.util.HashSet getPossibleContexts(UserContext user,
                                             int nodeNumber)
                                      throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method returns a list of contexts which can be used to change the node.
Overrides:
getPossibleContexts in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has to be asserted.
Returns:
a java.util.HashSet of Strings which represent a context in readable form..
Throws:
org.mmbase.SecurityException - maybe

check

public boolean check(UserContext user,
                     int nodeNumber,
                     Operation operation)
              throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method checks if an operation is permitted on a certain node done by a certain user.
Overrides:
check in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has to be checked.
operation - The operation which will be performed.
Returns:
true if the operation is permitted, false if the operation is not permitted,

assert

public void assert(UserContext user,
                   int nodeNumber,
                   Operation operation)
            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method asserts that an operation is permitted on a certain node done by a certain user. If not, a exception is thrown
Overrides:
assert in class Authorization
Following copied from class: org.mmbase.security.Authorization
Parameters:
user - The UserContext, containing the information about the user.
nodeid - The id of the MMObjectNode, which has to be asserted.
operation - The operation which will be performed.
Throws:
org.mmbase.SecurityException - If the assertion fails


MMBase 2001