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, setAnnotationClass
public 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 AuthorizingAnnotationHandler
a
- 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–2017 The Apache Software Foundation. All rights reserved.