Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.security
Class DefaultPermissionProvider

java.lang.Object
  extended by org.nuxeo.ecm.core.security.DefaultPermissionProvider
All Implemented Interfaces:
PermissionProvider, PermissionProviderLocal

public class DefaultPermissionProvider
extends Object
implements PermissionProviderLocal

Author:
Bogdan Stefanescu, Olivier Grisel

Constructor Summary
DefaultPermissionProvider()
           
 
Method Summary
 String[] getAliasPermissions(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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPermissionProvider

public DefaultPermissionProvider()
Method Detail

getUserVisiblePermissionDescriptors

public List<UserVisiblePermission> getUserVisiblePermissionDescriptors(String typeName)
                                                                throws ClientException
Specified by:
getUserVisiblePermissionDescriptors in interface PermissionProvider
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
Throws:
ClientException

getUserVisiblePermissionDescriptors

public List<UserVisiblePermission> getUserVisiblePermissionDescriptors()
                                                                throws ClientException
Specified by:
getUserVisiblePermissionDescriptors in interface PermissionProvider
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)
Throws:
ClientException

getSubPermissions

public String[] getSubPermissions(String perm)
                           throws ClientException
Specified by:
getSubPermissions in interface PermissionProvider
Parameters:
perm - the name of a registered compound permission
Returns:
the list of permission names of sub-permissions of 'perm'
Throws:
ClientException - if 'perm' is not a registered permission

getAliasPermissions

public String[] getAliasPermissions(String perm)
                             throws ClientException
Specified by:
getAliasPermissions in interface PermissionProvider
Parameters:
perm - the name of a registered permission
Returns:
the list of alias permissions to 'perm'
Throws:
ClientException - if 'perm' is not a registered permission

getPermissionGroups

public String[] getPermissionGroups(String perm)
Specified by:
getPermissionGroups in interface PermissionProvider
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

getPermissions

public String[] getPermissions()
Specified by:
getPermissions in interface PermissionProvider
Returns:
an array of a all registered permission names

registerDescriptor

public void registerDescriptor(PermissionDescriptor descriptor)
                        throws Exception
Specified by:
registerDescriptor in interface PermissionProviderLocal
Throws:
Exception

unregisterDescriptor

public void unregisterDescriptor(PermissionDescriptor descriptor)
Specified by:
unregisterDescriptor in interface PermissionProviderLocal

registerDescriptor

public void registerDescriptor(PermissionVisibilityDescriptor descriptor)
Specified by:
registerDescriptor in interface PermissionProviderLocal

unregisterDescriptor

public void unregisterDescriptor(PermissionVisibilityDescriptor descriptor)
Specified by:
unregisterDescriptor in interface PermissionProviderLocal

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.