Class ProfileAuthorizer
java.lang.Object
org.pac4j.core.authorization.authorizer.ProfileAuthorizer
- All Implemented Interfaces:
Authorizer
- Direct Known Subclasses:
AbstractCheckAuthenticationAuthorizer,AbstractRequireElementAuthorizer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanhandleError(WebContext context, SessionStore sessionStore) Handle the error.booleanisAllAuthorized(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) If all profiles are authorized.booleanisAnyAuthorized(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) If any of the profiles is authorized.protected abstract booleanisProfileAuthorized(WebContext context, SessionStore sessionStore, UserProfile profile) Whether a specific profile is authorized.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pac4j.core.authorization.authorizer.Authorizer
isAuthorized
-
Constructor Details
-
ProfileAuthorizer
public ProfileAuthorizer()
-
-
Method Details
-
isAllAuthorized
public boolean isAllAuthorized(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) If all profiles are authorized.- Parameters:
context- the web contextsessionStore- the session storeprofiles- the user profiles- Returns:
- whether all profiles are authorized
-
isAnyAuthorized
public boolean isAnyAuthorized(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) If any of the profiles is authorized.- Parameters:
context- the web contextsessionStore- the session storeprofiles- 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 contextsessionStore- the session storeprofile- the user profile- Returns:
- whether a specific profile is authorized
-
handleError
Handle the error.- Parameters:
context- the web contextsessionStore- the session store- Returns:
false
-