public class ProjectRightHelper extends AbstractLogEnabled implements Serviceable, Component, PluginAware
Modifier and Type | Field and Description |
---|---|
private static String |
__PROJECT_RIGHT_PROFILE |
private static String |
__RIGHT_ADD_MEMBER
Project Right to add a member to a project
|
private static String |
__RIGHT_ADD_PLACE
Right to add a place
|
private static String |
__RIGHT_ADD_TAG
Right to add a tag
|
private static String |
__RIGHT_DELETE_PLACE
Right to delete a place
|
private static String |
__RIGHT_DELETE_TAG
Right to delete a tag
|
private static String |
__RIGHT_REMOVE_MEMBER
Project Right to remove a member from the project
|
protected CurrentUserProvider |
_currentUserProvider
Current user provider
|
protected WorkspaceModuleExtensionPoint |
_moduleManagerEP
Module managers EP
|
private String |
_pluginName |
private ProfileAssignmentStorageExtensionPoint |
_profileAssignmentStorageEP
The profile storage
|
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() |
private boolean |
_hasRightOnMembers(Project project,
String rightId) |
private boolean |
_hasRightOnTagsOrPlaces(Project project,
String rightId) |
boolean |
canAddMember(Project project)
Determines if the current user has right to add member on project
|
boolean |
canAddPlace(Project project)
Determines if the current user has right to add places on project
|
boolean |
canAddTag(Project project)
Determines if the current user has right to add tags on project
|
boolean |
canEditMember(Project project)
Determines if the current user has right to edit member on project
|
boolean |
canRemoveMember(Project project)
Determines if the current user has right to add member on project
|
boolean |
canRemovePlace(Project project)
Determines if the current user has right to remove places on project
|
boolean |
canRemoveTag(Project project)
Determines if the current user has right to remove tags on project
|
boolean |
canViewMembers(Project project)
Determines if the current user can view the members of a project
|
String |
getAllowedProfileOnModule(Project project,
WorkspaceModule module,
JCRProjectMember member)
Get the first allowed profile on project's module for a given member
|
String |
getAllowedProfileOnProject(Project project,
JCRProjectMember member)
Get the first allowed profile on project for a given member
|
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)
Get the list of profiles and the list of modules available for rights affectation in the project.
|
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
@Obsolete private static final String __PROJECT_RIGHT_PROFILE
private static final String __RIGHT_ADD_MEMBER
private static final String __RIGHT_REMOVE_MEMBER
private static final String __RIGHT_ADD_TAG
private static final String __RIGHT_DELETE_TAG
private static final String __RIGHT_ADD_PLACE
private static final String __RIGHT_DELETE_PLACE
protected AmetysObjectResolver _resolver
protected ProjectManager _projectManager
protected RightManager _rightManager
protected RightProfilesDAO _rightProfilesDao
protected CurrentUserProvider _currentUserProvider
protected WorkspaceModuleExtensionPoint _moduleManagerEP
private ProfileAssignmentStorageExtensionPoint _profileAssignmentStorageEP
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()
@Obsolete public String getAllowedProfileOnProject(Project project, JCRProjectMember member)
project
- the projectmember
- the memberpublic String getAllowedProfileOnModule(Project project, WorkspaceModule module, JCRProjectMember member)
project
- the projectmodule
- The workspace modulemember
- the memberpublic Map<String,Object> getProjectRightsData(String projectName)
projectName
- The project to check if the modules are activated. Can be null to ignore@Obsolete 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)
@Obsolete private Map<String,Object> _getProjectRightData()
public boolean canViewMembers(Project project)
project
- the projectpublic boolean canAddMember(Project project)
project
- the projectpublic boolean canEditMember(Project project)
project
- the projectpublic boolean canRemoveMember(Project project)
project
- the projectprivate boolean _hasRightOnMembers(Project project, String rightId)
public boolean canAddTag(Project project)
project
- the projectpublic boolean canRemoveTag(Project project)
project
- the projectpublic boolean canAddPlace(Project project)
project
- the projectpublic boolean canRemovePlace(Project project)
project
- the projectprivate boolean _hasRightOnTagsOrPlaces(Project project, String rightId)
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