public class AuthorizedAnnotationAttributes extends Object
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 similar to the Commons Attributes approach, however they are using Java 5 language-level metadata support.
Authorized
Constructor and Description |
---|
AuthorizedAnnotationAttributes() |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getAttributes(Class<?> target)
Get the
Secured attributes for a given target class. |
Collection<?> |
getAttributes(Class<?> clazz,
Class<?> filter) |
Collection<?> |
getAttributes(Field field) |
Collection<?> |
getAttributes(Field field,
Class<?> clazz) |
Collection<String> |
getAttributes(Method method)
Get the
Secured attributes for a given target method. |
Collection<?> |
getAttributes(Method method,
Class<?> clazz) |
boolean |
getRequireAll(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(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(Method method)
Determine if this method has the @Authorized annotation even on it
|
public Collection<String> getAttributes(Class<?> target)
Secured
attributes for a given target class.target
- The target methodSecurityConfig
public Collection<String> getAttributes(Method method)
Secured
attributes for a given target method.method
- The target methodSecurityConfig
public boolean getRequireAll(Class<?> target)
target
- the class to act onAuthorized.requireAll()
public boolean getRequireAll(Method method)
method
- Authorized.requireAll()
public boolean hasAuthorizedAnnotation(Method method)
method
- public Collection<?> getAttributes(Class<?> clazz, Class<?> filter)
public Collection<?> getAttributes(Method method, Class<?> clazz)
public Collection<?> getAttributes(Field field)
public Collection<?> getAttributes(Field field, Class<?> clazz)
Copyright © 2024 OpenMRS Inc.. All rights reserved.