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 java.lang.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 Summary
Constructors Constructor Description ProfileAuthorizer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
handleError(WebContext context, SessionStore sessionStore)
Handle the error.boolean
isAllAuthorized(WebContext context, SessionStore sessionStore, java.util.List<UserProfile> profiles)
If all profiles are authorized.boolean
isAnyAuthorized(WebContext context, SessionStore sessionStore, java.util.List<UserProfile> profiles)
If any of the profiles is authorized.protected abstract boolean
isProfileAuthorized(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, wait
-
Methods inherited from interface org.pac4j.core.authorization.authorizer.Authorizer
isAuthorized
-
-
-
-
Method Detail
-
isAllAuthorized
public boolean isAllAuthorized(WebContext context, SessionStore sessionStore, java.util.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, java.util.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
protected boolean handleError(WebContext context, SessionStore sessionStore)
Handle the error.- Parameters:
context
- the web contextsessionStore
- the session store- Returns:
false
-
-