Class AuthorizationPolicyMarshaller
- java.lang.Object
-
- org.uberfire.backend.server.authz.AuthorizationPolicyMarshaller
-
public class AuthorizationPolicyMarshaller extends Object
Class used to convert anAuthorizationPolicyinstance into/from a set of key/value pairs.The format of the key/value pairs is:
"classifier.identifier.setting.extra=value"
Where:- classifier = role|group
- identifier = An existing role or group identifier (depending on the classifier type)
- setting = home|priority|permission
- extra = Extra setting information. Mandatory for instance to define the permission's name
- value = The setting value (depends on the setting selected). Value expected per setting type:
- home: An existing perspective identifier to redirect after login
- priority: An integer indicating how priority is this role|group compared to others. Used for conflict resolution.
- permission: A name representing a specific feature or capability over a given resource.
For example:
#Role "admin" role.admin.home=Home role.admin.priority=10 role.admin.permission.perspective.read=true role.admin.permission.perspective.read.Dashboard=false # Role "user" role.user.home=Dashboard role.user.priority=0 role.user.permission.perspective.read=false role.user.permission.perspective.read.Home=true role.user.permission.perspective.read.Dashboard=true
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAuthorizationPolicyMarshaller.Keystatic classAuthorizationPolicyMarshaller.ReadModeDifferent ways to specify what are the target entries to read when calling theread(AuthorizationPolicyBuilder, String, String, ReadMode)method.
-
Constructor Summary
Constructors Constructor Description AuthorizationPolicyMarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationPolicyMarshaller.Keyparse(String key)voidread(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, String key, String value)It reads key/value pair passed as a parameter and it calls to the rightAuthorizationPolicyBuildermethod .voidread(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, String key, String value, AuthorizationPolicyMarshaller.ReadMode readMode)It reads key/value pair passed as a parameter and it calls to the rightAuthorizationPolicyBuildermethod .voidread(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, Map... input)It reads all the entries from the collection of property files passed as a parameter.voidremove(org.jboss.errai.security.shared.api.Group group, org.uberfire.security.authz.AuthorizationPolicy policy, Map out)voidwrite(String homePerspectiveId, Map out)voidwrite(org.jboss.errai.security.shared.api.Group group, int priority, Map out)voidwrite(org.jboss.errai.security.shared.api.Group group, String homePerspectiveId, Map out)voidwrite(org.jboss.errai.security.shared.api.Group group, org.uberfire.security.authz.PermissionCollection permissions, Map out)voidwrite(org.jboss.errai.security.shared.api.Role role, int priority, Map out)voidwrite(org.jboss.errai.security.shared.api.Role role, String homePerspectiveId, Map out)voidwrite(org.jboss.errai.security.shared.api.Role role, org.uberfire.security.authz.PermissionCollection permissions, Map out)voidwrite(org.uberfire.security.authz.AuthorizationPolicy policy, Map out)Dumps theAuthorizationPolicyinstance passed as a parameter into the outputPropertiesobject specified.voidwrite(org.uberfire.security.authz.PermissionCollection permissions, Map out)
-
-
-
Method Detail
-
read
public void read(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, Map... input)It reads all the entries from the collection of property files passed as a parameter. For every entry a call to the properAuthorizationPolicyBuildermethod is executed.The valid format for the entries is specified in the class description.
- Parameters:
builder- TheAuthorizationPolicyBuilderused to register every processed entry.input- The property objects containing the authz policy entries
-
read
public void read(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, String key, String value)It reads key/value pair passed as a parameter and it calls to the rightAuthorizationPolicyBuildermethod .The valid format for an key/value pair is specified in the class description.
- Parameters:
builder- TheAuthorizationPolicyBuilderused to register the entry.key- The key to readvalue- The value to read
-
read
public void read(org.uberfire.security.impl.authz.AuthorizationPolicyBuilder builder, String key, String value, AuthorizationPolicyMarshaller.ReadMode readMode)It reads key/value pair passed as a parameter and it calls to the rightAuthorizationPolicyBuildermethod .The valid format for an key/value pair is specified in the class description.
- Parameters:
builder- TheAuthorizationPolicyBuilderused to register the entry.key- The key to readvalue- The value to readreadMode- TheAuthorizationPolicyMarshaller.ReadModedetermines if the specified key shall be included or excluded
-
write
public void write(org.uberfire.security.authz.AuthorizationPolicy policy, Map out)Dumps theAuthorizationPolicyinstance passed as a parameter into the outputPropertiesobject specified.The format for an key/value pair is specified in the class description.
- Parameters:
policy- TheAuthorizationPolicyto serializeout- ThePropertiesinstance used as output
-
write
public void write(org.uberfire.security.authz.PermissionCollection permissions, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Role role, String homePerspectiveId, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Role role, int priority, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Role role, org.uberfire.security.authz.PermissionCollection permissions, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Group group, String homePerspectiveId, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Group group, int priority, Map out)
-
write
public void write(org.jboss.errai.security.shared.api.Group group, org.uberfire.security.authz.PermissionCollection permissions, Map out)
-
remove
public void remove(org.jboss.errai.security.shared.api.Group group, org.uberfire.security.authz.AuthorizationPolicy policy, Map out)
-
parse
public AuthorizationPolicyMarshaller.Key parse(String key)
-
-