Class SimplePageAuthorizationStrategy

  • All Implemented Interfaces:

    public abstract class SimplePageAuthorizationStrategy
    extends AbstractPageAuthorizationStrategy
    A very simple authorization strategy that takes a supertype (a base class or tagging interface) and performs a simple authorization check by calling the abstract method isAuthorized() whenever a Page class that extends or implements the supertype is about to be instantiated. If that method returns true, page instantiation proceeds normally. If it returns false, the user is automatically directed to the specified sign-in page for authentication, which will presumably allow authorization to succeed once they have signed in.

    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());
    Eelco Hillenius, Jonathan Locke
    • Constructor Detail

      • SimplePageAuthorizationStrategy

        public SimplePageAuthorizationStrategy​(Class<?> securePageSuperType,
                                               Class<S> signInPageClass)
        Type Parameters:
        S -
        securePageSuperType - The class or interface supertype that indicates that a given Page requires authorization
        signInPageClass - The sign in page class