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
public abstract class AbstractRequireElementAuthorizer<E> extends ProfileAuthorizer
An authorizer to require elements.- Since:
- 1.8.1
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Constructor Description AbstractRequireElementAuthorizer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
check(WebContext context, SessionStore sessionStore, UserProfile profile, E element)
Check a specific element.java.util.Set<E>
getElements()
boolean
isAuthorized(WebContext context, SessionStore sessionStore, java.util.List<UserProfile> profiles)
Checks if the user profiles and / or the current web context are authorized.void
setElements(E... elements)
void
setElements(java.util.List<E> elements)
void
setElements(java.util.Set<E> elements)
-
Methods inherited from class org.pac4j.core.authorization.authorizer.ProfileAuthorizer
handleError, isAllAuthorized, isAnyAuthorized, isProfileAuthorized
-
-
-
-
Field Detail
-
elements
protected java.util.Set<E> elements
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(WebContext context, SessionStore sessionStore, java.util.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
public java.util.Set<E> getElements()
-
setElements
public void setElements(java.util.Set<E> elements)
-
setElements
public void setElements(java.util.List<E> elements)
-
setElements
public void setElements(E... elements)
-
-