Class ProjectRightHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.rights.ProjectRightHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper related to rights management for projects.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
WorkspaceModule> Association ContentTypeId, Moduleprotected CurrentUserProvider
Current user providerprotected WorkspaceModuleExtensionPoint
Module managers EPprotected ProjectManager
Project managerprotected AmetysObjectResolver
Ametys object resolverprotected RightManager
Right managerprotected RightProfilesDAO
Right profiles managerprotected WorkspaceModuleExtensionPoint
Workspace Module ExtensionPointstatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAddMember
(Project project) Determines if the current user has right to add member on projectboolean
Determines if the current user has right to add tags on projectboolean
canEditMember
(Project project) Determines if the current user has right to edit member on projectboolean
canRemoveMember
(Project project) Determines if the current user has right to add member on projectboolean
canRemoveTag
(Project project) Determines if the current user has right to remove tags on projectboolean
canViewMembers
(Project project) Determines if the current user can view the members of a projectRetrieves all project profile given the "profile list" configuration parameter Profile order is guaranteed to be the same as in the configuration parameter.Retrieves all project profiles ids given the "profile list" configuration parameter Profile order is guaranteed to be the same as in the configuration parameter.The association of all project content types and associated modulesgetProjectRightsData
(String projectName) Get the list of profiles and the list of modules available for rights affectation in the project.boolean
hasReadAccess
(Project project) Test if the current user has a read access on the projectboolean
hasRight
(String rightId, ExplorerNode explorerNode) Test if the current user has the right on an explorer nodeboolean
Test if the current user has the right on the projectvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_resolver
Ametys object resolver -
_projectManager
Project manager -
_rightManager
Right manager -
_rightProfilesDao
Right profiles manager -
_currentUserProvider
Current user provider -
_workspaceModuleEP
Workspace Module ExtensionPoint -
_contentTypesToModule
Association ContentTypeId, Module -
_moduleManagerEP
Module managers EP
-
-
Constructor Details
-
ProjectRightHelper
public ProjectRightHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getProjectContentTypesAndModules
The association of all project content types and associated modules- Returns:
- The association
-
getProfilesIds
Retrieves all project profiles ids given the "profile list" configuration parameter Profile order is guaranteed to be the same as in the configuration parameter.- Returns:
- the projects
-
getProfiles
Retrieves all project profile given the "profile list" configuration parameter Profile order is guaranteed to be the same as in the configuration parameter.- Returns:
- the projects
-
getProjectRightsData
Get the list of profiles and the list of modules available for rights affectation in the project.- Parameters:
projectName
- The project to check if the modules are activated. Can be null to ignore- Returns:
- the project rights data
-
canViewMembers
Determines if the current user can view the members of a project- Parameters:
project
- the project- Returns:
- true if user can view members
-
canAddMember
Determines if the current user has right to add member on project- Parameters:
project
- the project- Returns:
- true if user can add member
-
canEditMember
Determines if the current user has right to edit member on project- Parameters:
project
- the project- Returns:
- true if user can edit member
-
canRemoveMember
Determines if the current user has right to add member on project- Parameters:
project
- the project- Returns:
- true if user can remove member
-
canAddTag
Determines if the current user has right to add tags on project- Parameters:
project
- the project- Returns:
- true if user can add tags
-
canRemoveTag
Determines if the current user has right to remove tags on project- Parameters:
project
- the project- Returns:
- true if user can remove tags
-
hasRight
Test if the current user has the right on the project- Parameters:
rightId
- The right idproject
- The project- Returns:
- true if has right
-
hasReadAccess
Test if the current user has a read access on the project- Parameters:
project
- The project- Returns:
- true if has read access
-
hasRight
Test if the current user has the right on an explorer node- Parameters:
rightId
- The right idexplorerNode
- The explorer node- Returns:
- true if has right
-