@Interceptor @Priority(value=5000) public class RolesPermittedInterceptor extends Object
Constructor and Description |
---|
RolesPermittedInterceptor(javax.enterprise.inject.spi.Bean<?> interceptedBean,
javax.enterprise.inject.spi.BeanManager beanManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkAccessPermitted(RolesPermitted roles,
javax.interceptor.InvocationContext invocationContext)
Check that the roles allowed by the class or method match the roles
currently granted to the caller.
|
static <A extends Annotation> |
getAnnotationFromMethod(javax.enterprise.inject.spi.BeanManager beanManager,
Method annotatedMethod,
Class<A> annotationType) |
Object |
method(javax.interceptor.InvocationContext invocationContext)
Method invoked whenever a method annotated with @Roles, or a method
within a class annotated with @Roles is called.
|
@Inject public RolesPermittedInterceptor(@Intercepted javax.enterprise.inject.spi.Bean<?> interceptedBean, javax.enterprise.inject.spi.BeanManager beanManager)
public Object method(javax.interceptor.InvocationContext invocationContext) throws Exception
invocationContext
- Context provided by Weld.Exception
public boolean checkAccessPermitted(RolesPermitted roles, javax.interceptor.InvocationContext invocationContext)
roles
- The roles declared within the @Roles annotation.invocationContext
- public static <A extends Annotation> Optional<A> getAnnotationFromMethod(javax.enterprise.inject.spi.BeanManager beanManager, Method annotatedMethod, Class<A> annotationType)
Copyright © 2019. All rights reserved.