public abstract class AbstractPageAuthorizationStrategy extends IAuthorizationStrategy.AllowAllAuthorizationStrategy
isPageAuthorized(Class)
, which gets called for Page classes when they are being
constructed.IAuthorizationStrategy.AllowAllAuthorizationStrategy
ALLOW_ALL
Constructor and Description |
---|
AbstractPageAuthorizationStrategy() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
instanceOf(Class<?> type,
Class<?> superType)
Works like instanceof operator where instanceOf(a, b) is the runtime equivalent of (a
instanceof b).
|
<T extends IRequestableComponent> |
isInstantiationAuthorized(Class<T> componentClass)
Checks whether an instance of the given component class may be created.
|
protected <T extends Page> |
isPageAuthorized(Class<T> pageClass)
Whether to page may be created.
|
isActionAuthorized, isResourceAuthorized
public final <T extends IRequestableComponent> boolean isInstantiationAuthorized(Class<T> componentClass)
IAuthorizationStrategy
IUnauthorizedComponentInstantiationListener
that is configured in
the security settings
will be called. The default implementation of
that listener throws a UnauthorizedInstantiationException
.
If you wish to implement a strategy that authenticates users which cannot access a given Page
(or other Component), you can simply throw a
RestartResponseAtInterceptPageException
in your implementation of
this method.
isInstantiationAuthorized
in interface IAuthorizationStrategy
isInstantiationAuthorized
in class IAuthorizationStrategy.AllowAllAuthorizationStrategy
componentClass
- The component class to checkIAuthorizationStrategy.isInstantiationAuthorized(java.lang.Class)
protected boolean instanceOf(Class<?> type, Class<?> superType)
type
- The type to checksuperType
- The interface or superclass that the type needs to implement or extendCopyright © 2006–2022 Apache Software Foundation. All rights reserved.