Class IsAnonymousAuthorizer<U extends UserProfile>
- java.lang.Object
-
- org.pac4j.core.authorization.authorizer.ProfileAuthorizer<U>
-
- org.pac4j.core.authorization.authorizer.AbstractCheckAuthenticationAuthorizer<U>
-
- org.pac4j.core.authorization.authorizer.IsAnonymousAuthorizer<U>
-
- All Implemented Interfaces:
Authorizer<U>
public class IsAnonymousAuthorizer<U extends UserProfile> extends AbstractCheckAuthenticationAuthorizer<U>
The user must be anonymous. To protect resources like a login page.- Since:
- 1.9.0
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Constructor Description IsAnonymousAuthorizer()
IsAnonymousAuthorizer(String redirectionUrl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <U extends UserProfile>
IsAnonymousAuthorizer<U>isAnonymous()
boolean
isAuthorized(WebContext context, List<U> profiles)
Checks if the user profiles and / or the current web context are authorized.boolean
isProfileAuthorized(WebContext context, U profile)
Whether a specific profile is authorized.-
Methods inherited from class org.pac4j.core.authorization.authorizer.AbstractCheckAuthenticationAuthorizer
getRedirectionUrl, handleError, setRedirectionUrl
-
Methods inherited from class org.pac4j.core.authorization.authorizer.ProfileAuthorizer
isAllAuthorized, isAnyAuthorized
-
-
-
-
Constructor Detail
-
IsAnonymousAuthorizer
public IsAnonymousAuthorizer()
-
IsAnonymousAuthorizer
public IsAnonymousAuthorizer(String redirectionUrl)
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(WebContext context, List<U> profiles)
Description copied from interface:Authorizer
Checks if the user profiles and / or the current web context are authorized.- Parameters:
context
- the web contextprofiles
- the user profiles- Returns:
- if the access is authorized
-
isProfileAuthorized
public boolean isProfileAuthorized(WebContext context, U profile)
Description copied from class:ProfileAuthorizer
Whether a specific profile is authorized.- Specified by:
isProfileAuthorized
in classProfileAuthorizer<U extends UserProfile>
- Parameters:
context
- the web contextprofile
- the user profile- Returns:
- whether a specific profile is authorized
-
isAnonymous
public static <U extends UserProfile> IsAnonymousAuthorizer<U> isAnonymous()
-
-