Class AbstractRequireElementAuthorizer<E>
java.lang.Object
org.pac4j.core.authorization.authorizer.ProfileAuthorizer
org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer<E>
- All Implemented Interfaces:
Authorizer
- Direct Known Subclasses:
AbstractRequireAllAuthorizer
,AbstractRequireAnyAuthorizer
An authorizer to require elements.
- Since:
- 1.8.1
- Author:
- Jerome Leleu
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
check
(WebContext context, SessionStore sessionStore, UserProfile profile, E element) Check a specific element.boolean
isAuthorized
(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) Checks if the user profiles and / or the current web context are authorized.void
setElements
(E... elements) void
setElements
(List<E> elements) void
setElements
(Set<E> elements) Methods inherited from class org.pac4j.core.authorization.authorizer.ProfileAuthorizer
handleError, isAllAuthorized, isAnyAuthorized, isProfileAuthorized
-
Field Details
-
elements
-
-
Constructor Details
-
AbstractRequireElementAuthorizer
public AbstractRequireElementAuthorizer()
-
-
Method Details
-
isAuthorized
public boolean isAuthorized(WebContext context, SessionStore sessionStore, List<UserProfile> profiles) Description copied from interface:Authorizer
Checks if the user profiles and / or the current web context are authorized.- Parameters:
context
- the web contextsessionStore
- the session storeprofiles
- the user profiles- Returns:
- if the access is authorized
-
check
protected abstract boolean check(WebContext context, SessionStore sessionStore, UserProfile profile, E element) Check a specific element.- Parameters:
context
- the web contextsessionStore
- the session storeprofile
- the profileelement
- the element to check- Returns:
- whether it is authorized for this element
-
getElements
-
setElements
-
setElements
-
setElements
-