Class AuthorizingAnnotationHandler
java.lang.Object
org.apache.shiro.aop.AnnotationHandler
org.apache.shiro.authz.aop.AuthorizingAnnotationHandler
- Direct Known Subclasses:
AuthenticatedAnnotationHandler,DenyAllAnnotationHandler,GuestAnnotationHandler,PermissionAnnotationHandler,PermitAllAnnotationHandler,RoleAnnotationHandler,RolesAllowedAnnotationHandler,UserAnnotationHandler
An AnnotationHandler that executes authorization (access control) behavior based on directive(s) found in a
JSR-175 Annotation.
- Since:
- 0.9.0
-
Field Summary
Fields inherited from class org.apache.shiro.aop.AnnotationHandler
annotationClass -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizingAnnotationHandler(Class<? extends Annotation> annotationClass) Constructs anAuthorizingAnnotationHandlerwho processes annotations of the specified type. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidEnsures the calling Subject is authorized to execute based on the directive(s) found in the given annotation.Methods inherited from class org.apache.shiro.aop.AnnotationHandler
getAnnotationClass, getSubject, setAnnotationClass
-
Constructor Details
-
AuthorizingAnnotationHandler
Constructs anAuthorizingAnnotationHandlerwho processes annotations of the specified type. Immediately callssuper(annotationClass).- Parameters:
annotationClass- the type of annotation this handler will process.
-
-
Method Details
-
assertAuthorized
Ensures the calling Subject is authorized to execute based on the directive(s) found in the given annotation. As this is an AnnotationMethodInterceptor, the implementations of this method typically inspect the annotation and perform a corresponding authorization check based.- Parameters:
a- theAnnotationto check for performing an authorization check.- Throws:
AuthorizationException- if the class/instance/method is not allowed to proceed/execute.
-