KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > security > implementation > cloudcontext > Verify


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.security.implementation.cloudcontext;
11
12 import org.mmbase.bridge.Query;
13 import java.util.Set JavaDoc;
14 import org.mmbase.security.implementation.cloudcontext.builders.*;
15 import org.mmbase.security.*;
16
17 /**
18  * Implementation of Authorization. Most implementation is delegated to the Contexts builder.
19  *
20  * @author Eduard Witteveen
21  * @author Pierre van Rooden
22  * @author Michiel Meeuwissen
23  * @version $Id: Verify.java,v 1.11.2.1 2006/09/07 12:46:49 pierre Exp $
24  * @see org.mmbase.security.implementation.cloudcontext.builders.Contexts
25  */

26 public class Verify extends Authorization {
27     // javadoc inherited
28
protected void load() {
29     }
30
31     // javadoc inherited
32
public void create(UserContext userContext, int nodeId) {
33         User user = (User) userContext;
34         // odd, getOwnerField is called in BasicNodeManager yet, so I wonder when this is called.
35
Contexts.getBuilder().setContext(user, nodeId, user.getOwnerField());
36     }
37
38     // javadoc inherited
39
public void update(UserContext userContext, int nodeId) {
40     }
41
42
43     // javadoc inherited
44
public void remove(UserContext userContext, int nodeId) {
45     }
46
47     // javadoc inherited
48
public boolean check(UserContext userContext, int nodeId, Operation operation) {
49         return Contexts.getBuilder().mayDo((User) userContext, nodeId, operation);
50     }
51
52     // javadoc inherited
53
public boolean check(UserContext userContext, int nodeId, int sourceNodeId, int destinationNodeId, Operation operation) {
54         //log.debug("check if operation: " + operation + " is valid for: " + usercontext + " for node with number # " + i + "(between 2 nodes..)");
55
return Contexts.getBuilder().mayDo((User) userContext, nodeId, sourceNodeId, destinationNodeId, operation);
56     }
57
58     // javadoc inherited
59
public String JavaDoc getContext(UserContext userContext, int nodeId) throws org.mmbase.security.SecurityException {
60         //log.debug("check if we may read the node with # " + i + " nodeid?");
61
return Contexts.getBuilder().getContext((User) userContext, nodeId);
62     }
63
64
65     // javadoc inherited
66
public void setContext(UserContext userContext, int nodeId, String JavaDoc context) throws org.mmbase.security.SecurityException {
67         //log.debug("[node #" + i + "] changed to context: " + s + " by [" + usercontext.getIdentifier() + "]");
68
Contexts.getBuilder().setContext((User) userContext, nodeId, context);
69     }
70
71     // javadoc inherited
72
public Set JavaDoc getPossibleContexts(UserContext userContext, int nodeId) throws org.mmbase.security.SecurityException {
73         return Contexts.getBuilder().getPossibleContexts((User) userContext, nodeId);
74     }
75
76     public Set JavaDoc getPossibleContexts(UserContext userContext) throws org.mmbase.security.SecurityException {
77         return Contexts.getBuilder().getPossibleContexts((User) userContext);
78     }
79
80     // javadoc inherited
81
public QueryCheck check(UserContext userContext, Query query, Operation operation) {
82         return Contexts.getBuilder().check((User) userContext, query, operation);
83
84     }
85 }
86
Popular Tags