Class ProfileAuthorizer

java.lang.Object
org.pac4j.core.authorization.authorizer.ProfileAuthorizer
All Implemented Interfaces:
Authorizer
Direct Known Subclasses:
AbstractCheckAuthenticationAuthorizer, AbstractRequireElementAuthorizer

public abstract class ProfileAuthorizer extends Object implements Authorizer
Authorizer which is valid if one of the profiles is authorized or all the profiles are authorized.
Since:
1.9.0
Author:
Jerome Leleu
  • Constructor Details

    • ProfileAuthorizer

      public ProfileAuthorizer()
  • Method Details

    • isAllAuthorized

      public boolean isAllAuthorized(WebContext context, SessionStore sessionStore, Iterable<UserProfile> profiles)
      If all profiles are authorized.
      Parameters:
      context - the web context
      sessionStore - the session store
      profiles - the user profiles
      Returns:
      whether all profiles are authorized
    • isAnyAuthorized

      public boolean isAnyAuthorized(WebContext context, SessionStore sessionStore, Iterable<UserProfile> profiles)
      If any of the profiles is authorized.
      Parameters:
      context - the web context
      sessionStore - the session store
      profiles - the user profiles
      Returns:
      whether any of the profiles is authorized
    • isProfileAuthorized

      protected abstract boolean isProfileAuthorized(WebContext context, SessionStore sessionStore, UserProfile profile)
      Whether a specific profile is authorized.
      Parameters:
      context - the web context
      sessionStore - the session store
      profile - the user profile
      Returns:
      whether a specific profile is authorized
    • handleError

      protected boolean handleError(WebContext context, SessionStore sessionStore)
      Handle the error.
      Parameters:
      context - the web context
      sessionStore - the session store
      Returns:
      false