public class RoleAnnotationHandler extends AuthorizingAnnotationHandler
RequiresRoles annotation is declared, and if so, performs
a role check to see if the calling Subject is allowed to proceed.annotationClass| Constructor and Description |
|---|
RoleAnnotationHandler()
Default no-argument constructor that ensures this handler looks for
RequiresRoles annotations. |
| Modifier and Type | Method and Description |
|---|---|
void |
assertAuthorized(Annotation a)
Ensures that the calling
Subject has the Annotation's specified roles, and if not, throws an
AuthorizingException indicating that access is denied. |
getAnnotationClass, getSubject, setAnnotationClasspublic RoleAnnotationHandler()
RequiresRoles annotations.public void assertAuthorized(Annotation a) throws AuthorizationException
Subject has the Annotation's specified roles, and if not, throws an
AuthorizingException indicating that access is denied.assertAuthorized in class AuthorizingAnnotationHandlera - the RequiresRoles annotation to use to check for one or more rolesAuthorizationException - if the calling Subject does not have the role(s) necessary to
proceed.Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.