Class FromAttributesAuthorizationGenerator
java.lang.Object
org.pac4j.core.authorization.generator.FromAttributesAuthorizationGenerator
- All Implemented Interfaces:
AuthorizationGenerator
Generate the authorization information by inspecting attributes.
The attributes containing the roles separated by the splitChar
property are defined in the constructor.
- Since:
- 1.5.0
- Author:
- Jerome Leleu
-
Constructor Summary
ConstructorDescriptionConstructor for FromAttributesAuthorizationGenerator.FromAttributesAuthorizationGenerator
(String[] roleAttributes) Constructor for FromAttributesAuthorizationGenerator.FromAttributesAuthorizationGenerator
(Collection<String> roleAttributes) Constructor for FromAttributesAuthorizationGenerator. -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(CallContext ctx, UserProfile profile) Generate the authorization information from and for the user profile.
-
Constructor Details
-
FromAttributesAuthorizationGenerator
public FromAttributesAuthorizationGenerator()Constructor for FromAttributesAuthorizationGenerator.
-
FromAttributesAuthorizationGenerator
Constructor for FromAttributesAuthorizationGenerator.
- Parameters:
roleAttributes
- aCollection
object
-
FromAttributesAuthorizationGenerator
Constructor for FromAttributesAuthorizationGenerator.
- Parameters:
roleAttributes
- an array ofString
objects
-
-
Method Details
-
generate
Generate the authorization information from and for the user profile.- Specified by:
generate
in interfaceAuthorizationGenerator
- Parameters:
ctx
- the current contextprofile
- the user profile for which to generate the authorization information.- Returns:
- the updated profile or a new one (optional)
-