Class RequireAnyRoleAuthorizer
- java.lang.Object
-
- org.pac4j.core.authorization.authorizer.ProfileAuthorizer
-
- org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer<E>
-
- org.pac4j.core.authorization.authorizer.AbstractRequireAnyAuthorizer<java.lang.String>
-
- org.pac4j.core.authorization.authorizer.RequireAnyRoleAuthorizer
-
- All Implemented Interfaces:
Authorizer
public class RequireAnyRoleAuthorizer extends AbstractRequireAnyAuthorizer<java.lang.String>
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
Constructors Constructor Description RequireAnyRoleAuthorizer()
RequireAnyRoleAuthorizer(java.lang.String... roles)
RequireAnyRoleAuthorizer(java.util.List<java.lang.String> roles)
RequireAnyRoleAuthorizer(java.util.Set<java.lang.String> roles)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
check(WebContext context, SessionStore sessionStore, UserProfile profile, java.lang.String element)
Check a specific element.static RequireAnyRoleAuthorizer
requireAnyRole(java.lang.String... roles)
static RequireAnyRoleAuthorizer
requireAnyRole(java.util.List<java.lang.String> roles)
static RequireAnyRoleAuthorizer
requireAnyRole(java.util.Set<java.lang.String> roles)
-
Methods inherited from class org.pac4j.core.authorization.authorizer.AbstractRequireAnyAuthorizer
isProfileAuthorized, toString
-
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 Detail
-
RequireAnyRoleAuthorizer
public RequireAnyRoleAuthorizer()
-
RequireAnyRoleAuthorizer
public RequireAnyRoleAuthorizer(java.lang.String... roles)
-
RequireAnyRoleAuthorizer
public RequireAnyRoleAuthorizer(java.util.List<java.lang.String> roles)
-
RequireAnyRoleAuthorizer
public RequireAnyRoleAuthorizer(java.util.Set<java.lang.String> roles)
-
-
Method Detail
-
check
protected boolean check(WebContext context, SessionStore sessionStore, UserProfile profile, java.lang.String element)
Description copied from class:AbstractRequireElementAuthorizer
Check a specific element.- Specified by:
check
in classAbstractRequireElementAuthorizer<java.lang.String>
- Parameters:
context
- the web contextsessionStore
- the session storeprofile
- the profileelement
- the element to check- Returns:
- whether it is authorized for this element
-
requireAnyRole
public static RequireAnyRoleAuthorizer requireAnyRole(java.lang.String... roles)
-
requireAnyRole
public static RequireAnyRoleAuthorizer requireAnyRole(java.util.List<java.lang.String> roles)
-
requireAnyRole
public static RequireAnyRoleAuthorizer requireAnyRole(java.util.Set<java.lang.String> roles)
-
-