Java Doc for Authorization.java in  » Database-ORM » MMBase » org » mmbase » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.security.Configurable
      org.mmbase.security.Authorization

All known Subclasses:   org.mmbase.security.implementation.basic.OwnerAuthorization,  org.mmbase.security.implementation.context.ContextAuthorization,  org.mmbase.security.NoAuthorization,
Authorization
abstract public class Authorization extends Configurable (Code)
The abstract implementation of the Authorization. To make your own implementation of authorization, you have to extend this class, and implement the abstract methods.
author:
   Eduard Witteveen
author:
   Michiel Meeuwissen
version:
   $Id: Authorization.java,v 1.29 2008/01/21 17:28:15 michiel Exp $

Inner Class :public static class QueryCheck

Field Summary
final public static  QueryCheckCOMPLETE_CHECK
     Constant which can be used as a result for the check query function.
final public static  QueryCheckNO_CHECK
     Constant which can be used as a result for the check query function.


Method Summary
abstract public  booleancheck(UserContext user, int nodeid, Operation operation)
     This method should be overrided by an extending class. This method checks if an operation is permitted on a certain node done by a certain user.
Parameters:
  user - The UserContext, containing the information the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be checked.It the action is CREATE then this will be interpreted as a typedef node.
Parameters:
  operation - The operation which will be performed.
abstract public  booleancheck(UserContext user, int nodeid, int srcnodeid, int dstnodeid, Operation operation)
     This method should 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.
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the relation which has to be checked.
public  booleancheck(UserContext user, Action ac, Parameters parameters)
     Checks whether user may do a certain action. Default implemetation simply uses default ActionChecker of the Action itself.
public  QueryCheckcheck(UserContext user, Query query, Operation operation)
     Checks rights on a query.
abstract public  voidcreate(UserContext user, int nodeid)
     This method should be overrided by an extending class.
abstract public  StringgetContext(UserContext user, int nodeid)
     This method could be overrided by an extending class. This method returns the context of a specific node.
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be asserted.
abstract public  Set<String>getPossibleContexts(UserContext user, int nodeid)
     This method could be overrided by an extending class. This method returns a list of contexts which can be used to change the node.
Parameters:
  user - The UserContext, containing the informationabout the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be asserted.
public  Set<String>getPossibleContexts(UserContext user)
     This method could be overrided by an extending class. This method returns a list of contexts availabel to a user when creating or searching for an object. The default implementation returns only the user's own default context.
Parameters:
  user - The UserContext, containing the informationabout the user.
abstract public  voidremove(UserContext user, int nodeid)
     This method should be overrided by an extending class.
abstract public  voidsetContext(UserContext user, int nodeid, String context)
     This method could be overrided by an extending class.
abstract public  voidupdate(UserContext user, int nodeid)
     This method should be overrided by an extending class.
public  voidverify(UserContext user, int nodeid, Operation operation)
     This method wraps the check-method with the same arguments.
public  voidverify(UserContext user, int nodeid, int srcnodeid, int dstnodeid, Operation operation)
     This method wraps the check-method with the same arguments.
final public  voidverify(UserContext user, Action ac, Parameters parameters)
    

Field Detail
COMPLETE_CHECK
final public static QueryCheck COMPLETE_CHECK(Code)
Constant which can be used as a result for the check query function. It means: 'No extra contraints to be added, but the query's result will not have to be postprocessed for security. This means that there are no restrictions on the given operation at all (normally: 'read' is permit to everybody).
since:
   MMBase-1.7



NO_CHECK
final public static QueryCheck NO_CHECK(Code)
Constant which can be used as a result for the check query function. It means: 'No extra contraints to be added, and the query's result will have to be postprocessed for security.
since:
   MMBase-1.7





Method Detail
check
abstract public boolean check(UserContext user, int nodeid, Operation operation)(Code)
This method should be overrided by an extending class. This method checks if an operation is permitted on a certain node done by a certain user.
Parameters:
  user - The UserContext, containing the information the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be checked.It the action is CREATE then this will be interpreted as a typedef node.
Parameters:
  operation - The operation which will be performed. true if the operation is permitted,false if the operation is not permitted,



check
abstract public boolean check(UserContext user, int nodeid, int srcnodeid, int dstnodeid, Operation operation)(Code)
This method should 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.
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the relation which has to be checked. If the operation is CREATEthen this will be interpreted as the typedef node (extending insrel) for the relation to becreated.
Parameters:
  srcnodeid - The id of the (new) source node of the relation.
Parameters:
  dstnodeid - The id of the (new) destination node of the relation.
Parameters:
  operation - The operation which will be performed (CREATE (createrelation) or CHANGE_RELATION (source and/or destinationare changed). true if the operation is permitted,false if the operation is not permitted,



check
public boolean check(UserContext user, Action ac, Parameters parameters)(Code)
Checks whether user may do a certain action. Default implemetation simply uses default ActionChecker of the Action itself. Extensions may provide configuration, e.g. make links between groups and/or user object with Action objects, to provide more fine grained control over which users may execute what 'actions'. in the MMBase cloud.
since:
   MMBase-1.9



check
public QueryCheck check(UserContext user, Query query, Operation operation)(Code)
Checks rights on a query. This means that the query is explored and (if possible) a constraint for it is constructed, which, if appied to the query, makes it return only checked results for the given user. Of course, this will normally only be implemented for the 'READ' operation. The constraint is not applied automaticly. This has to be done by using BasicQuery.setSecurityConstraint().
Parameters:
  user - The UserContext, for which the query must be considered
Parameters:
  query - The query to be explored A QueryCheck structure (containing whether the constriant is sufficient, and thenew constraint or null).
since:
   MMBase-1.7



create
abstract public void create(UserContext user, int nodeid)(Code)
This method should 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.
Parameters:
  user - The UserContext, containing the informationabout the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has just been added tothe MMBase cloud.



getContext
abstract public String getContext(UserContext user, int nodeid) throws SecurityException(Code)
This method could be overrided by an extending class. This method returns the context of a specific node.
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be asserted. the context setting of the node.
exception:
  SecurityException - If operation is not allowed(needs read rights)



getPossibleContexts
abstract public Set<String> getPossibleContexts(UserContext user, int nodeid) throws SecurityException(Code)
This method could be overrided by an extending class. This method returns a list of contexts which can be used to change the node.
Parameters:
  user - The UserContext, containing the informationabout the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be asserted. a Set of Strings whichrepresent a context in readable form..
exception:
  SecurityException -



getPossibleContexts
public Set<String> getPossibleContexts(UserContext user) throws SecurityException(Code)
This method could be overrided by an extending class. This method returns a list of contexts availabel to a user when creating or searching for an object. The default implementation returns only the user's own default context.
Parameters:
  user - The UserContext, containing the informationabout the user. a Set of Strings whichrepresent a context in readable form..
exception:
  SecurityException -
since:
   MMBase-1.8.2



remove
abstract public void remove(UserContext user, int nodeid)(Code)
This method should 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.
Parameters:
  user - The UserContext, containing the informationabout the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has just been removedin the cloud.



setContext
abstract public void setContext(UserContext user, int nodeid, String context) throws SecurityException(Code)
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.
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has to be asserted.
Parameters:
  context - The context which rights the node will get
exception:
  SecurityException - If operation is not allowed
exception:
  SecurityException - If context is not known



update
abstract public void update(UserContext user, int nodeid)(Code)
This method should 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
Parameters:
  user - The UserContext, containing the information about the user.
Parameters:
  nodeid - The id of the MMObjectNode, which has just been changedin the cloud.



verify
public void verify(UserContext user, int nodeid, Operation operation) throws SecurityException(Code)
This method wraps the check-method with the same arguments. The only difference being that it throws on exception if the specified operation is not permitted. It is wise to override check, and not verify (And I wonder why this method is not simply final).
exception:
  SecurityException - If the assertion fails
See Also:   Authorization.check(UserContext,int,Operation)



verify
public void verify(UserContext user, int nodeid, int srcnodeid, int dstnodeid, Operation operation) throws SecurityException(Code)
This method wraps the check-method with the same arguments. The only difference being that it throws on exception if the specified operation is not permitted. It is wise to override check, and not verify (And I wonder why this method is not simply final).
exception:
  SecurityException - If the assertion fails
See Also:   Authorization.check(UserContext,int,int,int,Operation)



verify
final public void verify(UserContext user, Action ac, Parameters parameters)(Code)

since:
   MMBase-1.9



Fields inherited from org.mmbase.security.Configurable
protected String configResource(Code)(Java Doc)
protected ResourceWatcher configWatcher(Code)(Java Doc)
protected MMBaseCop manager(Code)(Java Doc)

Methods inherited from org.mmbase.security.Configurable
final public void load(MMBaseCop manager, ResourceWatcher configWatcher, String configPath)(Code)(Java Doc)
abstract protected void load()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.