public class ProjectRightHelper extends AbstractLogEnabled implements Serviceable, Component, PluginAware
Modifier and Type | Field and Description |
---|---|
private static String |
__PROJECT_RIGHT_PROFILE |
protected CurrentUserProvider |
_currentUserProvider
Current user provider
|
protected WorkspaceModuleExtensionPoint |
_moduleManagerEP
Module managers EP
|
private String |
_pluginName |
protected ProjectManager |
_projectManager
Project manager
|
protected AmetysObjectResolver |
_resolver
Ametys object resolver
|
protected RightManager |
_rightManager
Right manager
|
protected RightProfilesDAO |
_rightProfilesDao
Right profiles manager
|
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
ProjectRightHelper() |
Modifier and Type | Method and Description |
---|---|
private Map<String,Object> |
_getModuleRightData(Project project,
WorkspaceModule module) |
private Map<String,Object> |
_getProfileRightData(Profile profile) |
private Map<String,Object> |
_getProjectRightData() |
List<Profile> |
getProfileList()
Retrieves all project profile given the "profile list" configuration parameter
Profile order is guaranteed to be the same as in the configuration parameter.
|
Map<String,Object> |
getProjectRightsData(String projectName,
boolean includeAllModules)
Get the list of profiles and the list of modules available for rights affectation in the project.
|
boolean |
hasReadAccess(ExplorerNode explorerNode)
Test if the current user has a read access on an explorer node
|
boolean |
hasReadAccess(Project project)
Test if the current user has a read access on the project
|
boolean |
hasReadAccess(Resource resource)
Test if the current user has a read access on a resource
|
boolean |
hasReadAccessOnExplorerNode(String explorerNodeId)
Test if the current user has a read access on an explorer node
|
boolean |
hasReadAccessOnProject(String projectId)
Test if the current user has a read access on the project
|
boolean |
hasRight(String rightId,
ExplorerNode explorerNode)
Test if the current user has the right on an explorer node
|
boolean |
hasRight(String rightId,
Project project)
Test if the current user has the right on the project
|
boolean |
hasRightOnExplorerNode(String rightId,
String explorerNodeId)
Test if the current user has the right on an explorer node
|
boolean |
hasRightOnProject(String rightId,
String projectId)
Test if the current user has the right on the project
|
void |
service(ServiceManager manager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
getLogger, setLogger
private static final String __PROJECT_RIGHT_PROFILE
protected AmetysObjectResolver _resolver
protected ProjectManager _projectManager
protected RightManager _rightManager
protected RightProfilesDAO _rightProfilesDao
protected CurrentUserProvider _currentUserProvider
protected WorkspaceModuleExtensionPoint _moduleManagerEP
private String _pluginName
public ProjectRightHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic List<Profile> getProfileList()
public Map<String,Object> getProjectRightsData(String projectName, boolean includeAllModules)
projectName
- The project to check if the modules are activated. Can be null to ignoreincludeAllModules
- True to include modules not manager by the WorkspaceModuleManagerExtensionPointprivate Map<String,Object> _getProfileRightData(Profile profile)
private Map<String,Object> _getModuleRightData(Project project, WorkspaceModule module)
private Map<String,Object> _getProjectRightData()
public boolean hasRightOnProject(String rightId, String projectId)
rightId
- The right idprojectId
- The project idpublic boolean hasRight(String rightId, Project project)
rightId
- The right idproject
- The projectpublic boolean hasReadAccessOnProject(String projectId)
projectId
- The project idpublic boolean hasReadAccess(Project project)
project
- The projectpublic boolean hasRightOnExplorerNode(String rightId, String explorerNodeId)
rightId
- The right idexplorerNodeId
- The explorer node idpublic boolean hasRight(String rightId, ExplorerNode explorerNode)
rightId
- The right idexplorerNode
- The explorer nodepublic boolean hasReadAccessOnExplorerNode(String explorerNodeId)
explorerNodeId
- The explorer node idpublic boolean hasReadAccess(ExplorerNode explorerNode)
explorerNode
- The explorer nodepublic boolean hasReadAccess(Resource resource)
resource
- The resource