org.mmbase.security.implementation.basic
Class OwnerAuthorization

java.lang.Object
  |
  +--org.mmbase.security.Authorization
        |
        +--org.mmbase.security.implementation.basic.OwnerAuthorization

public class OwnerAuthorization
extends Authorization


Fields inherited from class org.mmbase.security.Authorization
configFile, fileWatcher, manager
 
Constructor Summary
OwnerAuthorization()
           
 
Method Summary
 void assert(UserContext user, int node, int srcNode, int dstNode, Operation operation)
          This method could be overrided by an extending class.
 void assert(UserContext user, int node, Operation operation)
          This method could be overrided by an extending class.
 boolean check(UserContext user, int nodeNumber, int srcNodeNumber, int dstNodeNumber, 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.Set getPossibleContexts(UserContext user, int nodeNumber)
          This method does nothing, except from returning a dummy value
 void load()
          This method could be overrided by an extending class.
 void remove(UserContext user, int node)
          This method could be overrided by an extending class.
 void setContext(UserContext user, int nodeNumber, java.lang.String context)
          This method does nothing, except from checking if the setContext was valid..
 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

OwnerAuthorization

public OwnerAuthorization()
Method Detail

load

public 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)
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)
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 node)
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.

check

public boolean check(UserContext user,
                     int nodeNumber,
                     Operation operation)
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 node,
                   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

check

public boolean check(UserContext user,
                     int nodeNumber,
                     int srcNodeNumber,
                     int dstNodeNumber,
                     Operation operation)
Description copied from class: Authorization
This method could be overrided by an extending class. This method checks if the creation of a certain relation or changing the source or destination of a certain relation done by a certain user is permitted.
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 relation which has to be checked.
srcnodeid - The id of the (new) source node of the relation.
dstnodeid - The id of the (new) destination node of the relation.
operation - The operation which will be performed (CREATE (create relation) or CHANGE_RELATION (source and/or destination are changed).
Returns:
true if the operation is permitted, false if the operation is not permitted,

assert

public void assert(UserContext user,
                   int node,
                   int srcNode,
                   int dstNode,
                   Operation operation)
            throws SecurityException
Description copied from class: Authorization
This method could be overrided by an extending class. This method asserts that creation of a certain relation or changing the source or destination of a certain relation done by a certain user is permitted. If not, an 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 relation which has to be asserted.
srcnodeid - The id of the (new) source node of the relation.
dstnodeid - The id of the (new) destination node of the relation.
operation - The operation which will be performed (CREATE (create relation) or CHANGE_RELATION (source and/or destination are changed).
Throws:
org.mmbase.SecurityException - If the assertion fails

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)

setContext

public void setContext(UserContext user,
                       int nodeNumber,
                       java.lang.String context)
                throws SecurityException
This method does nothing, except from checking if the setContext was valid..
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

getPossibleContexts

public java.util.Set getPossibleContexts(UserContext user,
                                         int nodeNumber)
                                  throws SecurityException
This method does nothing, except from returning a dummy value
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 Set of Strings which represent a context in readable form..
Throws:
org.mmbase.SecurityException - maybe


MMBase 2002