Package org.nuxeo.ecm.core.security
Class DefaultPermissionProvider
- java.lang.Object
-
- org.nuxeo.ecm.core.security.DefaultPermissionProvider
-
- All Implemented Interfaces:
PermissionProvider
,PermissionProviderLocal
public class DefaultPermissionProvider extends Object implements PermissionProviderLocal
- Author:
- Bogdan Stefanescu, Olivier Grisel
-
-
Field Summary
Fields Modifier and Type Field Description Map<String,PermissionVisibilityDescriptor>
mergedPermissionsVisibility
-
Constructor Summary
Constructors Constructor Description DefaultPermissionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<String>
computeAllGroups(String permissionName, Set<String> alreadyProcessed)
protected void
computeMergedGroups()
protected void
computeMergedPermissions()
protected void
computeMergedPermissionsVisibility()
String[]
getAliasPermissions(String perm)
protected MergedPermissionDescriptor
getPermission(String perm)
String[]
getPermissionGroups(String perm)
String[]
getPermissions()
String[]
getSubPermissions(String perm)
List<UserVisiblePermission>
getUserVisiblePermissionDescriptors()
List<UserVisiblePermission>
getUserVisiblePermissionDescriptors(String typeName)
void
registerDescriptor(PermissionDescriptor descriptor)
void
registerDescriptor(PermissionVisibilityDescriptor descriptor)
void
unregisterDescriptor(PermissionDescriptor descriptor)
void
unregisterDescriptor(PermissionVisibilityDescriptor descriptor)
-
-
-
Field Detail
-
mergedPermissionsVisibility
public Map<String,PermissionVisibilityDescriptor> mergedPermissionsVisibility
-
-
Method Detail
-
getUserVisiblePermissionDescriptors
public List<UserVisiblePermission> getUserVisiblePermissionDescriptors(String typeName)
- Specified by:
getUserVisiblePermissionDescriptors
in interfacePermissionProvider
- Parameters:
typeName
- the name of a Core type of the document whose ACP is to be edited by the user- Returns:
- get the sorted list of UserVisiblePermission objects to be used in the permission management screen of the UI (be it web based, a rich client or any-thing else) ; if no specific permissions are registered for typeName, the default list is returned
-
getUserVisiblePermissionDescriptors
public List<UserVisiblePermission> getUserVisiblePermissionDescriptors()
- Specified by:
getUserVisiblePermissionDescriptors
in interfacePermissionProvider
- Returns:
- get the sorted list of UserVisiblePermission objects to be used in the permission management screen of the UI (be it web based, a rich client or any-thing else)
-
computeMergedPermissionsVisibility
protected void computeMergedPermissionsVisibility()
-
getSubPermissions
public String[] getSubPermissions(String perm)
- Specified by:
getSubPermissions
in interfacePermissionProvider
- Parameters:
perm
- the name of a registered compound permission- Returns:
- the list of permission names of sub-permissions of 'perm'
-
getAliasPermissions
public String[] getAliasPermissions(String perm)
- Specified by:
getAliasPermissions
in interfacePermissionProvider
- Parameters:
perm
- the name of a registered permission- Returns:
- the list of alias permissions to 'perm'
-
getPermission
protected MergedPermissionDescriptor getPermission(String perm)
-
getPermissionGroups
public String[] getPermissionGroups(String perm)
- Specified by:
getPermissionGroups
in interfacePermissionProvider
- Parameters:
perm
- the name of a registered permissions that belongs to permission groups (aka compound permissions)- Returns:
- an array of a all compound permissions 'perm' is a sub-permission of, directly or not ; returns null if 'perm' is not registered or if 'perm' does not belong to any compound permission
-
computeMergedGroups
protected void computeMergedGroups()
-
computeAllGroups
protected Set<String> computeAllGroups(String permissionName, Set<String> alreadyProcessed)
-
getPermissions
public String[] getPermissions()
- Specified by:
getPermissions
in interfacePermissionProvider
- Returns:
- an array of a all registered permission names
-
computeMergedPermissions
protected void computeMergedPermissions()
-
registerDescriptor
public void registerDescriptor(PermissionDescriptor descriptor)
- Specified by:
registerDescriptor
in interfacePermissionProviderLocal
-
unregisterDescriptor
public void unregisterDescriptor(PermissionDescriptor descriptor)
- Specified by:
unregisterDescriptor
in interfacePermissionProviderLocal
-
registerDescriptor
public void registerDescriptor(PermissionVisibilityDescriptor descriptor)
- Specified by:
registerDescriptor
in interfacePermissionProviderLocal
-
unregisterDescriptor
public void unregisterDescriptor(PermissionVisibilityDescriptor descriptor)
- Specified by:
unregisterDescriptor
in interfacePermissionProviderLocal
-
-