Class RequireAnyAttributeAuthorizer
- 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.RequireAnyAttributeAuthorizer
-
- All Implemented Interfaces:
Authorizer
public class RequireAnyAttributeAuthorizer extends AbstractRequireAnyAuthorizer<java.lang.String>
This isRequireAnyAttributeAuthorizer
which checks profile attributes for the specified element, and optionally may pattern-check the configured value. In practice, you may use this authorizer to see if the profile contains attribute X and optionally, whether X has a value that matches pattern Y.- Since:
- 1.9.2
- Author:
- Misagh Moayyed
-
-
Field Summary
-
Fields inherited from class org.pac4j.core.authorization.authorizer.AbstractRequireElementAuthorizer
elements
-
-
Constructor Summary
Constructors Constructor Description RequireAnyAttributeAuthorizer()
RequireAnyAttributeAuthorizer(java.lang.String valueToMatch)
-
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 RequireAnyAttributeAuthorizer
requireAnyAttribute(java.lang.String valueToMatch)
-
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
-
-
-
-
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
-
requireAnyAttribute
public static RequireAnyAttributeAuthorizer requireAnyAttribute(java.lang.String valueToMatch)
-
-