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 similiar 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 |
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 |
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 getAttributes(Class target)
Secured attributes for a given target class.target - The target methodSecurityConfigAttributes#getAttributespublic Collection getAttributes(Method method)
Secured attributes for a given target method.method - The target methodSecurityConfigAttributes#getAttributespublic 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 © 2018 OpenMRS LLC.. All Rights Reserved.