|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy
public abstract class AbstractPageAuthorizationStrategy
An abstract base class for implementing simple authorization of Pages. Users should override
isPageAuthorized(Class), which gets called for Page classes when they are being
constructed.
| Field Summary |
|---|
| Fields inherited from interface org.apache.wicket.authorization.IAuthorizationStrategy |
|---|
ALLOW_ALL |
| Constructor Summary | |
|---|---|
AbstractPageAuthorizationStrategy()
|
|
| Method Summary | ||
|---|---|---|
protected boolean |
instanceOf(Class<?> type,
Class<?> superType)
Works like instanceof operator where instanceOf(a, b) is the runtime equivalent of (a instanceof b). |
|
boolean |
isActionAuthorized(Component component,
Action action)
Gets whether the given action is permitted. |
|
|
isInstantiationAuthorized(Class<T> componentClass)
Checks whether an instance of the given component class may be created. |
|
protected
|
isPageAuthorized(Class<T> pageClass)
Whether to page may be created. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPageAuthorizationStrategy()
| Method Detail |
|---|
public boolean isActionAuthorized(Component component,
Action action)
IAuthorizationStrategy
isActionAuthorized in interface IAuthorizationStrategycomponent - The component to be acted uponaction - The action to authorize on the component
IAuthorizationStrategy.isActionAuthorized(org.apache.wicket.Component,
org.apache.wicket.authorization.Action)public final <T extends IRequestableComponent> boolean isInstantiationAuthorized(Class<T> componentClass)
IAuthorizationStrategyIUnauthorizedComponentInstantiationListener 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 IAuthorizationStrategycomponentClass - The component class to check
IAuthorizationStrategy.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 extend
protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass)
T - the type of the pagepageClass - The Page class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||