Java Doc for LabelBasedAclVoter.java in  » Security » acegi-security » org » acegisecurity » vote » 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 » Security » acegi security » org.acegisecurity.vote 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.acegisecurity.vote.AbstractAclVoter
      org.acegisecurity.vote.LabelBasedAclVoter

LabelBasedAclVoter
public class LabelBasedAclVoter extends AbstractAclVoter (Code)

This Acl voter will evaluate methods based on labels applied to incoming arguments. It will only check methods that have been properly tagged in the MethodSecurityInterceptor with the value stored in attributeIndicatingLabeledOperation. If a method has been tagged, then it examines each argument, and if the argument implements LabeledData , then it will asses if the user's list of granted authorities matches.

By default, if none of the arguments are labeled, then the access will be granted. This can be overridden by setting allowAccessIfNoAttributesAreLabeled to false in the Spring context file.

In many situations, different values are linked together to define a common label, it is necessary to define a map in the application context that links user-assigned label access to domain object labels. This is done by setting up the labelMap in the application context.


author:
   Greg Turnquist
version:
   $Id: LabelBasedAclVoter.java 1962 2007-08-27 17:21:16Z luke_t $
See Also:   org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor




Method Summary
public  voidsetAllowAccessIfNoAttributesAreLabeled(boolean allowAccessIfNoAttributesAreLabeled)
     Set whether or not to allow the user to run methods in which none of the incoming arguments are labeled.
public  voidsetAttributeIndicatingLabeledOperation(String attributeIndicatingLabeledOperation)
     Each method intended for evaluation by this voter must include this tag name in the definition of the MethodSecurityInterceptor, indicating if this voter should evaluate the arguments and compare them against the label map.
public  voidsetLabelMap(Map labelMap)
     Set the map that correlate a user's assigned label against domain object values that are considered data labels.
public  booleansupports(ConfigAttribute attribute)
     This acl voter will only evaluate labeled methods if they are marked in the security interceptor's configuration with the attribute stored in attributeIndicatingLabeledOperation.
public  intvote(Authentication authentication, Object object, ConfigAttributeDefinition config)
     Vote on whether or not the user has all the labels necessary to match the method argument's labeled data.



Method Detail
setAllowAccessIfNoAttributesAreLabeled
public void setAllowAccessIfNoAttributesAreLabeled(boolean allowAccessIfNoAttributesAreLabeled)(Code)
Set whether or not to allow the user to run methods in which none of the incoming arguments are labeled.

Default value: true, users can run such methods.


Parameters:
  allowAccessIfNoAttributesAreLabeled - boolean



setAttributeIndicatingLabeledOperation
public void setAttributeIndicatingLabeledOperation(String attributeIndicatingLabeledOperation)(Code)
Each method intended for evaluation by this voter must include this tag name in the definition of the MethodSecurityInterceptor, indicating if this voter should evaluate the arguments and compare them against the label map.
Parameters:
  attributeIndicatingLabeledOperation - string



setLabelMap
public void setLabelMap(Map labelMap)(Code)
Set the map that correlate a user's assigned label against domain object values that are considered data labels. An example application context configuration of a labelMap:
 <bean id="accessDecisionManager" class="org.acegisecurity.vote.UnanimousBased">
 <property name="allowIfAllAbstainDecisions"><value>false</value></property>
 <property name="decisionVoters">
 <list>
 <bean class="org.acegisecurity.vote.RoleVoter"/>
 <bean class="org.acegisecurity.vote.LabelBasedAclVoter">
 <property name="attributeIndicatingLabeledOperation">
 <value>LABELED_OPERATION</value>
 </property>
 <property name="labelMap">
 <map>
 <entry key="DATA_LABEL_BLUE">
 <list>
 <value>blue</value>
 <value>indigo</value>
 <value>purple</value>
 </list>
 </entry>
 <entry key="LABEL_ORANGE">
 <list>
 <value>orange</value>
 <value>sunshine</value>
 <value>amber</value>
 </list>
 </entry>
 <entry key="LABEL_ADMIN">
 <list>
 <value>blue</value>
 <value>indigo</value>
 <value>purple</value>
 <value>orange</value>
 <value>sunshine</value>
 <value>amber</value>
 </list>
 </entry>
 </map>
 </property>
 </bean>
 </list>
 </property>
 </bean>
 

Parameters:
  labelMap - a map structured as in the above example.



supports
public boolean supports(ConfigAttribute attribute)(Code)
This acl voter will only evaluate labeled methods if they are marked in the security interceptor's configuration with the attribute stored in attributeIndicatingLabeledOperation.
Parameters:
  attribute - DOCUMENT ME! DOCUMENT ME!
See Also:   org.acegisecurity.vote.AbstractAclVoter
See Also:   org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor



vote
public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config)(Code)
Vote on whether or not the user has all the labels necessary to match the method argument's labeled data.
Parameters:
  authentication - DOCUMENT ME!
Parameters:
  object - DOCUMENT ME!
Parameters:
  config - DOCUMENT ME! ACCESS_ABSTAIN, ACCESS_GRANTED, or ACCESS_DENIED.



Methods inherited from org.acegisecurity.vote.AbstractAclVoter
protected Object getDomainObjectInstance(Object secureObject)(Code)(Java Doc)
public Class getProcessDomainObjectClass()(Code)(Java Doc)
public void setProcessDomainObjectClass(Class processDomainObjectClass)(Code)(Java Doc)
public boolean supports(Class clazz)(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.