Search in sources :

Example 1 with PrivilegeDefinition

use of org.forgerock.openam.rest.authz.PrivilegeDefinition in project OpenAM by OpenRock.

the class ForgerockRestGuiceModule method getPrivilegeDefinitions.

@Provides
@Singleton
public Map<String, PrivilegeDefinition> getPrivilegeDefinitions() {
    final Map<String, PrivilegeDefinition> definitions = new HashMap<>();
    final PrivilegeDefinition evaluateDefinition = PrivilegeDefinition.getInstance("evaluate", PrivilegeDefinition.Action.READ);
    definitions.put("evaluate", evaluateDefinition);
    definitions.put("evaluateTree", evaluateDefinition);
    definitions.put("copy", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
    definitions.put("move", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
    definitions.put("schema", PrivilegeDefinition.getInstance("schema", PrivilegeDefinition.Action.READ));
    definitions.put("validate", PrivilegeDefinition.getInstance("validate", PrivilegeDefinition.Action.READ));
    definitions.put("template", PrivilegeDefinition.getInstance("template", PrivilegeDefinition.Action.READ));
    definitions.put("getPropertyNames", PrivilegeDefinition.getInstance("getPropertyNames", PrivilegeDefinition.Action.READ));
    definitions.put("getProperty", PrivilegeDefinition.getInstance("getProperty", PrivilegeDefinition.Action.READ));
    definitions.put("setProperty", PrivilegeDefinition.getInstance("setProperty", PrivilegeDefinition.Action.MODIFY));
    definitions.put("deleteProperty", PrivilegeDefinition.getInstance("deleteProperty", PrivilegeDefinition.Action.MODIFY));
    return definitions;
}
Also used : HashMap(java.util.HashMap) PrivilegeDefinition(org.forgerock.openam.rest.authz.PrivilegeDefinition) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 HashMap (java.util.HashMap)1 Singleton (javax.inject.Singleton)1 PrivilegeDefinition (org.forgerock.openam.rest.authz.PrivilegeDefinition)1