|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.security.Configurable
org.mmbase.security.Authorization
org.mmbase.security.implementation.basic.OwnerAuthorization
A very simple Authorization implementation, based an a property file. Every user will be present in this file as one property. Only the keys are of importance when authorizing, because it determines the 'possible users' and 'possible contexts'. Furthermore everybody is authorized to read, you may create if you are known, (so not anonymous), and you may edit, if you are either administrator or editing your 'own' node.
| Nested Class Summary |
| Nested classes inherited from class org.mmbase.security.Authorization |
Authorization.QueryCheck |
| Field Summary |
| Fields inherited from class org.mmbase.security.Authorization |
COMPLETE_CHECK, NO_CHECK |
| Fields inherited from class org.mmbase.security.Configurable |
configFile, configResource, configWatcher, manager |
| Constructor Summary | |
OwnerAuthorization()
|
|
| Method Summary | |
boolean |
check(UserContext user,
int nodeNumber,
int srcNodeNumber,
int dstNodeNumber,
Operation operation)
This method should be overrided by an extending class. |
boolean |
check(UserContext user,
int nodeNumber,
Operation operation)
This method should be overrided by an extending class. |
Authorization.QueryCheck |
check(UserContext user,
Query query,
Operation operation)
Checks rights on a query. |
void |
create(UserContext user,
int nodeNumber)
This method should be overrided by an extending class. |
String |
getContext(UserContext user,
int nodeNumber)
This method could be overrided by an extending class. |
Set |
getPossibleContexts(UserContext user,
int nodeNumber)
Returns a list of all users in accounts.properties |
void |
load()
This method should be overrided by an extending class. |
void |
remove(UserContext user,
int node)
This method should be overrided by an extending class. |
void |
setContext(UserContext user,
int nodeNumber,
String context)
This method does nothing, except from checking if the setContext was valid.. |
void |
update(UserContext user,
int nodeNumber)
This method should be overrided by an extending class. |
| Methods inherited from class org.mmbase.security.Authorization |
verify, verify |
| Methods inherited from class org.mmbase.security.Configurable |
load |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OwnerAuthorization()
| Method Detail |
public void load()
Configurable
load in class Configurable
public void create(UserContext user,
int nodeNumber)
Authorization
create in class Authorizationuser - The UserContext, containing the information
about the user.nodeNumber - The id of the MMObjectNode, which has just been added to
the MMBase cloud.
public void update(UserContext user,
int nodeNumber)
Authorization
update in class Authorizationuser - The UserContext, containing the information about the user.nodeNumber - The id of the MMObjectNode, which has just been changed
in the cloud.
public void remove(UserContext user,
int node)
Authorization
remove in class Authorizationuser - The UserContext, containing the information
about the user.node - The id of the MMObjectNode, which has just been removed
in the cloud.
public boolean check(UserContext user,
int nodeNumber,
Operation operation)
Authorization
check in class Authorizationuser - The UserContext, containing the information the user.nodeNumber - The id of the MMObjectNode, which has to be checked.
It the action is CREATE then this will be interpreted as a typedef node.operation - The operation which will be performed.
true if the operation is permitted,
false if the operation is not permitted,
public boolean check(UserContext user,
int nodeNumber,
int srcNodeNumber,
int dstNodeNumber,
Operation operation)
Authorization
check in class Authorizationuser - The UserContext, containing the information about the user.nodeNumber - The id of the relation which has to be checked. If the operation is CREATE
then this will be interpreted as the typedef node (extending insrel) for the relation to be
created.srcNodeNumber - The id of the (new) source node of the relation.dstNodeNumber - 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).
true if the operation is permitted,
false if the operation is not permitted,
public String getContext(UserContext user,
int nodeNumber)
throws SecurityException
Authorization
getContext in class Authorizationuser - The UserContext, containing the information about the user.nodeNumber - The id of the MMObjectNode, which has to be asserted.
SecurityException - If operation is not allowed(needs read rights)
public void setContext(UserContext user,
int nodeNumber,
String context)
throws SecurityException
setContext in class Authorizationuser - The UserContext, containing the information about the user.nodeNumber - The id of the MMObjectNode, which has to be asserted.context - The context which rights the node will get
SecurityException - If operation is not allowed
public Set getPossibleContexts(UserContext user,
int nodeNumber)
throws SecurityException
getPossibleContexts in class Authorizationuser - The UserContext, containing the information
about the user.nodeNumber - The id of the MMObjectNode, which has to be asserted.
Set of Strings which
represent a context in readable form..
SecurityException
public Authorization.QueryCheck check(UserContext user,
Query query,
Operation operation)
Authorization
check in class Authorizationuser - The UserContext, for which the query must be consideredquery - The query to be explored
Authorization.QueryCheck structure (containing whether the constriant is sufficient, and the
new constraint or null).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||