Class PermissionAnnotationHandler
java.lang.Object
org.apache.shiro.aop.AnnotationHandler
org.apache.shiro.authz.aop.AuthorizingAnnotationHandler
org.apache.shiro.authz.aop.PermissionAnnotationHandler
Checks to see if a @
RequiresPermissions annotation is
declared, and if so, performs a permission check to see if the calling Subject is allowed continued
access.- Since:
- 0.9.0
-
Field Summary
Fields inherited from class org.apache.shiro.aop.AnnotationHandler
annotationClass -
Constructor Summary
ConstructorsConstructorDescriptionDefault no-argument constructor that ensures this handler looks forRequiresPermissionsannotations. -
Method Summary
Methods inherited from class org.apache.shiro.aop.AnnotationHandler
getAnnotationClass, getSubject, setAnnotationClass
-
Constructor Details
-
PermissionAnnotationHandler
public PermissionAnnotationHandler()Default no-argument constructor that ensures this handler looks forRequiresPermissionsannotations.
-
-
Method Details
-
getAnnotationValue
Returns the annotationvalue, from which the Permission will be constructed.- Parameters:
a- the RequiresPermissions annotation being inspected.- Returns:
- the annotation's
value, from which the Permission will be constructed.
-
assertAuthorized
Ensures that the callingSubjecthas the Annotation's specified permissions, and if not, throws anAuthorizingExceptionindicating access is denied.- Specified by:
assertAuthorizedin classAuthorizingAnnotationHandler- Parameters:
a- the RequiresPermission annotation being inspected to check for one or more permissions- Throws:
AuthorizationException- if the callingSubjectdoes not have the permission(s) necessary to continue access or execution.
-