Class RequireAnyPermissionAuthorizer<U extends UserProfile>
- java.lang.Object
-
- org.pac4j.core.authorization.authorizer.ProfileAuthorizer<U>
-
- org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer<E,U>
-
- org.pac4j.core.authorization.authorizer.AbstractRequireAnyAuthorizer<String,U>
-
- org.pac4j.core.authorization.authorizer.RequireAnyPermissionAuthorizer<U>
-
- Type Parameters:
U
- the user profile
- All Implemented Interfaces:
Authorizer<U>
public class RequireAnyPermissionAuthorizer<U extends UserProfile> extends AbstractRequireAnyAuthorizer<String,U>
Checks an access if the user profile has any of the permissions.- 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 RequireAnyPermissionAuthorizer()
RequireAnyPermissionAuthorizer(String... permissions)
RequireAnyPermissionAuthorizer(List<String> permissions)
RequireAnyPermissionAuthorizer(Set<String> permissions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
check(WebContext context, U profile, String element)
Check a specific element.static <U extends UserProfile>
RequireAnyPermissionAuthorizer<U>requireAnyPermission(String... permissions)
static <U extends UserProfile>
RequireAnyPermissionAuthorizer<U>requireAnyPermission(List<String> permissions)
static <U extends UserProfile>
RequireAnyPermissionAuthorizer<U>requireAnyPermission(Set<String> permissions)
-
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 Detail
-
RequireAnyPermissionAuthorizer
public RequireAnyPermissionAuthorizer()
-
RequireAnyPermissionAuthorizer
public RequireAnyPermissionAuthorizer(String... permissions)
-
-
Method Detail
-
check
protected boolean check(WebContext context, U profile, String element)
Description copied from class:AbstractRequireElementAuthorizer
Check a specific element.- Specified by:
check
in classAbstractRequireElementAuthorizer<String,U extends UserProfile>
- Parameters:
context
- the web contextprofile
- the profileelement
- the element to check- Returns:
- whether it is authorized for this element
-
requireAnyPermission
public static <U extends UserProfile> RequireAnyPermissionAuthorizer<U> requireAnyPermission(String... permissions)
-
requireAnyPermission
public static <U extends UserProfile> RequireAnyPermissionAuthorizer<U> requireAnyPermission(List<String> permissions)
-
requireAnyPermission
public static <U extends UserProfile> RequireAnyPermissionAuthorizer<U> requireAnyPermission(Set<String> permissions)
-
-