Class ProjectRightHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.rights.ProjectRightHelper
- All Implemented Interfaces:
DeferredServiceable,LogEnabled,Component
public class ProjectRightHelper
extends AbstractLogEnabled
implements DeferredServiceable, Component
Helper related to rights management for projects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, WorkspaceModule> Association ContentTypeId, Moduleprotected CurrentUserProviderCurrent user providerprotected WorkspaceModuleExtensionPointModule managers EPprotected ProjectManagerProject managerprotected AmetysObjectResolverAmetys object resolverprotected RightManagerRight managerprotected RightProfilesDAORight profiles managerprotected WorkspacesHelperWorkspace helperprotected WorkspaceModuleExtensionPointWorkspace Module ExtensionPointstatic final StringAvalon Role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAddMember(Project project) Determines if the current user has right to add member on projectbooleanDetermines if the current user has right to add tags on projectbooleancanEditMember(Project project) Determines if the current user has right to edit member on projectbooleancanRemoveMember(Project project) Determines if the current user has right to add member on projectbooleancanRemoveTag(Project project) Determines if the current user has right to remove tags on projectbooleancanViewMembers(Project project) Determines if the current user can view the members of a projectvoiddeferredService(ServiceManager manager) Pass theServiceManagerused to access other components.Retrieves 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.booleanhasCatalogReadAccess(ZoneItem zoneItem) Test if current user has read access on catalog sitebooleanTest if the current user has a read access on current projectbooleanhasReadAccess(Project project) Test if the current user has a read access on the projectbooleanhasReadAccessOnModule(String moduleId) Determines if current user has read access to module on current projectbooleanhasReadAccessOnModule(Project project, String moduleId) Determines if current user has read access to module on given projectbooleanhasReadAccessOnModule(Project project, String moduleId, UserIdentity userIdentity) Determines if current user has read access to module on given projectbooleanhasRight(String rightId, ExplorerNode explorerNode) Test if the current user has the right on an explorer nodebooleanTest if the current user has the right on the projectbooleanhasRightOnModule(String rightId, String moduleId) Determines if current user has a given right on module on current projectbooleanhasRightOnModule(Project project, String rightId, String moduleId) Determines if current user has a given right on module on given projectMethods 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 -
_workspaceHelper
Workspace helper
-
-
Constructor Details
-
ProjectRightHelper
public ProjectRightHelper()
-
-
Method Details
-
deferredService
Description copied from interface:DeferredServiceablePass theServiceManagerused to access other components.- Specified by:
deferredServicein interfaceDeferredServiceable- Parameters:
manager- TheServiceManagerwhich thisDeferredServiceableuses. Must not benull.- Throws:
ServiceException- if an error occurs
-
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
-
hasReadAccessOnModule
Determines if current user has read access to module on current project- Parameters:
moduleId- the module id- Returns:
- true if current user has read access, false otherwise
-
hasReadAccessOnModule
Determines if current user has read access to module on given project- Parameters:
project- the projectmoduleId- the module id- Returns:
- true if current user has right, false otherwise
-
hasReadAccessOnModule
Determines if current user has read access to module on given project- Parameters:
project- the projectmoduleId- the module iduserIdentity- the user identity- Returns:
- true if current user has right, false otherwise
-
hasRightOnModule
Determines if current user has a given right on module on current project- Parameters:
rightId- the right to checkmoduleId- the module id- Returns:
- true if current user has read access, false otherwise
-
hasRightOnModule
Determines if current user has a given right on module on given project- Parameters:
project- the projectrightId- the right to checkmoduleId- the module id- Returns:
- true if current user has right, false otherwise
-
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 current project- Returns:
- true if has read access
-
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
-
hasCatalogReadAccess
Test if current user has read access on catalog site- Parameters:
zoneItem- the zoneItem holding the catalog service. Cannot be null- Returns:
- true if current user has read access
-