public abstract class SimplePageAuthorizationStrategy extends AbstractPageAuthorizationStrategy
In your Application.init() method do something like the following:
SimplePageAuthorizationStrategy authorizationStrategy = new SimplePageAuthorizationStrategy( MySecureWebPage.class, MySignInPage.class) { protected boolean isAuthorized() { // Authorize access based on user authentication in the session return (((MySession)Session.get()).isSignedIn()); } }; getSecuritySettings().setAuthorizationStrategy(authorizationStrategy);
IAuthorizationStrategy.AllowAllAuthorizationStrategy
ALLOW_ALL
Constructor and Description |
---|
SimplePageAuthorizationStrategy(Class<?> securePageSuperType,
Class<S> signInPageClass)
Construct.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
isAuthorized()
Gets whether the current user/session is authorized to instantiate a page class which extends
or implements the supertype (base class or tagging interface) passed to the constructor.
|
protected <T extends Page> |
isPageAuthorized(Class<T> pageClass)
Whether to page may be created.
|
instanceOf, isInstantiationAuthorized
isActionAuthorized, isResourceAuthorized
public SimplePageAuthorizationStrategy(Class<?> securePageSuperType, Class<S> signInPageClass)
S
- securePageSuperType
- The class or interface supertype that indicates that a given Page requires
authorizationsignInPageClass
- The sign in page classprotected <T extends Page> boolean isPageAuthorized(Class<T> pageClass)
AbstractPageAuthorizationStrategy
isPageAuthorized
in class AbstractPageAuthorizationStrategy
T
- the type of the pagepageClass
- The Page classAbstractPageAuthorizationStrategy.isPageAuthorized(java.lang.Class)
protected abstract boolean isAuthorized()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.