org.openmrs.annotation
Class AuthorizedAnnotationAttributes

java.lang.Object
  extended by org.openmrs.annotation.AuthorizedAnnotationAttributes

public class AuthorizedAnnotationAttributes
extends java.lang.Object

Annotation attributes metadata implementation used for authorization method interception.

This Attributes implementation will return security configuration for classes described using the Secured Java 5 annotation.

The SecurityAnnotationAttributes implementation can be used to configure a MethodDefinitionAttributes and MethodSecurityInterceptor bean definition (see below).

For example:

 <bean id="attributes" 
     class="org.acegisecurity.annotation.SecurityAnnotationAttributes"/>
 
 <bean id="objectDefinitionSource" 
     class="org.acegisecurity.intercept.method.MethodDefinitionAttributes">
     <property name="attributes">
         <ref local="attributes"/>
     </property>
 </bean>
 
 <bean id="securityInterceptor" 
     class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
      . . .
      <property name="objectDefinitionSource">
          <ref local="objectDefinitionSource"/>
      </property>
 </bean>
 

These security annotations are similiar to the Commons Attributes approach, however they are using Java 5 language-level metadata support.

See Also:
Authorized

Constructor Summary
AuthorizedAnnotationAttributes()
           
 
Method Summary
 java.util.Collection getAttributes(java.lang.Class target)
          Get the Secured attributes for a given target class.
 java.util.Collection getAttributes(java.lang.Class clazz, java.lang.Class filter)
           
 java.util.Collection getAttributes(java.lang.reflect.Field field)
           
 java.util.Collection getAttributes(java.lang.reflect.Field field, java.lang.Class clazz)
           
 java.util.Collection getAttributes(java.lang.reflect.Method method)
          Get the Secured attributes for a given target method.
 java.util.Collection getAttributes(java.lang.reflect.Method method, java.lang.Class clazz)
           
 boolean getRequireAll(java.lang.Class target)
          Returns whether or not to require that the user have all of the privileges in order to be "authorized" for this class
 boolean getRequireAll(java.lang.reflect.Method method)
          Returns whether or not to require that the user have all of the privileges in order to be "authorized" for this method
 boolean hasAuthorizedAnnotation(java.lang.reflect.Method method)
          Determine if this method has the @Authorized annotation even on it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizedAnnotationAttributes

public AuthorizedAnnotationAttributes()
Method Detail

getAttributes

public java.util.Collection getAttributes(java.lang.Class target)
Get the Secured attributes for a given target class.

Parameters:
target - The target method
Returns:
Collection of SecurityConfig
See Also:
Attributes#getAttributes

getAttributes

public java.util.Collection getAttributes(java.lang.reflect.Method method)
Get the Secured attributes for a given target method.

Parameters:
method - The target method
Returns:
Collection of SecurityConfig
See Also:
Attributes#getAttributes

getRequireAll

public boolean getRequireAll(java.lang.Class target)
Returns whether or not to require that the user have all of the privileges in order to be "authorized" for this class

Parameters:
target - the class to act on
Returns:
boolean true/false whether to "and" privileges together
See Also:
Authorized.requireAll()

getRequireAll

public boolean getRequireAll(java.lang.reflect.Method method)
Returns whether or not to require that the user have all of the privileges in order to be "authorized" for this method

Parameters:
method -
Returns:
boolean true/false whether to "and" privileges together
See Also:
Authorized.requireAll()

hasAuthorizedAnnotation

public boolean hasAuthorizedAnnotation(java.lang.reflect.Method method)
Determine if this method has the @Authorized annotation even on it

Parameters:
method -
Returns:
boolean true/false whether this method is annotated for OpenMRS

getAttributes

public java.util.Collection getAttributes(java.lang.Class clazz,
                                          java.lang.Class filter)

getAttributes

public java.util.Collection getAttributes(java.lang.reflect.Method method,
                                          java.lang.Class clazz)

getAttributes

public java.util.Collection getAttributes(java.lang.reflect.Field field)

getAttributes

public java.util.Collection getAttributes(java.lang.reflect.Field field,
                                          java.lang.Class clazz)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change