public class CompoundAuthorizationStrategy extends Object implements IAuthorizationStrategy
IAuthorizationStrategy.AllowAllAuthorizationStrategy
ALLOW_ALL
Constructor and Description |
---|
CompoundAuthorizationStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
add(IAuthorizationStrategy strategy)
Adds a strategy to the chain
|
boolean |
isActionAuthorized(Component component,
Action action)
Gets whether the given action is permitted.
|
<T extends IRequestableComponent> |
isInstantiationAuthorized(Class<T> componentClass)
Checks whether an instance of the given component class may be created.
|
boolean |
isResourceAuthorized(IResource resource,
PageParameters parameters)
Checks whether a request with some parameters is allowed to a resource.
|
public final void add(IAuthorizationStrategy strategy)
strategy
- Strategy to addpublic 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
componentClass
- The component class to checkIAuthorizationStrategy.isInstantiationAuthorized(java.lang.Class)
public final boolean isActionAuthorized(Component component, Action action)
IAuthorizationStrategy
isActionAuthorized
in interface IAuthorizationStrategy
component
- The component to be acted uponaction
- The action to authorize on the componentIAuthorizationStrategy.isActionAuthorized(org.apache.wicket.Component,
org.apache.wicket.authorization.Action)
public boolean isResourceAuthorized(IResource resource, PageParameters parameters)
IAuthorizationStrategy
isResourceAuthorized
in interface IAuthorizationStrategy
resource
- The resource that should be processedparameters
- The request parameterstrue
if the request to this resource is allowed.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.