Class RequireAnyRoleAuthorizer
java.lang.Object
org.pac4j.core.authorization.authorizer.ProfileAuthorizer
org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer<E>
org.pac4j.core.authorization.authorizer.AbstractRequireAnyAuthorizer<String>
org.pac4j.core.authorization.authorizer.RequireAnyRoleAuthorizer
- All Implemented Interfaces:
Authorizer
Checks an access if the user profile has any of the roles.
- Since:
- 1.8.0
- Author:
- Jerome Leleu
-
Field Summary
Fields inherited from class org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer
elements
-
Constructor Summary
ConstructorDescriptionRequireAnyRoleAuthorizer
(String... roles) RequireAnyRoleAuthorizer
(List<String> roles) RequireAnyRoleAuthorizer
(Set<String> roles) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
check
(WebContext context, SessionStore sessionStore, UserProfile profile, String element) Check a specific element.static RequireAnyRoleAuthorizer
requireAnyRole
(String... roles) static RequireAnyRoleAuthorizer
requireAnyRole
(List<String> roles) static RequireAnyRoleAuthorizer
requireAnyRole
(Set<String> roles) Methods inherited from class org.pac4j.core.authorization.authorizer.AbstractRequireAnyAuthorizer
isProfileAuthorized
Methods inherited from class org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer
getElements, isAuthorized, setElements, setElements, setElements
Methods inherited from class org.pac4j.core.authorization.authorizer.ProfileAuthorizer
handleError, isAllAuthorized, isAnyAuthorized
-
Constructor Details
-
RequireAnyRoleAuthorizer
public RequireAnyRoleAuthorizer() -
RequireAnyRoleAuthorizer
-
RequireAnyRoleAuthorizer
-
RequireAnyRoleAuthorizer
-
-
Method Details
-
check
protected boolean check(WebContext context, SessionStore sessionStore, UserProfile profile, String element) Description copied from class:AbstractRequireElementAuthorizer
Check a specific element.- Specified by:
check
in classAbstractRequireElementAuthorizer<String>
- Parameters:
context
- the web contextsessionStore
- the session storeprofile
- the profileelement
- the element to check- Returns:
- whether it is authorized for this element
-
requireAnyRole
-
requireAnyRole
-
requireAnyRole
-