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.Getter for the fieldelements
.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) Setter for the fieldelements
.void
setElements
(List<E> elements) Setter for the fieldelements
.void
setElements
(Set<E> elements) Setter for the fieldelements
.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) 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
Getter for the field
elements
.- Returns:
- a
Set
object
-
setElements
Setter for the field
elements
.- Parameters:
elements
- aSet
object
-
setElements
Setter for the field
elements
.- Parameters:
elements
- aList
object
-
setElements
Setter for the field
elements
.- Parameters:
elements
- a E object
-