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 Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      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

      public Set<Profile> 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

      public Map<String,Object> getProjectRightsData(String projectName)
      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

      public boolean canViewMembers(Project project)
      Determines if the current user can view the members of a project
      Parameters:
      project - the project
      Returns:
      true if user can view members
    • canAddMember

      public boolean canAddMember(Project project)
      Determines if the current user has right to add member on project
      Parameters:
      project - the project
      Returns:
      true if user can add member
    • canEditMember

      public boolean canEditMember(Project project)
      Determines if the current user has right to edit member on project
      Parameters:
      project - the project
      Returns:
      true if user can edit member
    • canRemoveMember

      public boolean canRemoveMember(Project project)
      Determines if the current user has right to add member on project
      Parameters:
      project - the project
      Returns:
      true if user can remove member
    • canAddTag

      public boolean canAddTag(Project project)
      Determines if the current user has right to add tags on project
      Parameters:
      project - the project
      Returns:
      true if user can add tags
    • canRemoveTag

      public boolean canRemoveTag(Project project)
      Determines if the current user has right to remove tags on project
      Parameters:
      project - the project
      Returns:
      true if user can remove tags
    • hasRight

      public boolean hasRight(String rightId, Project project)
      Test if the current user has the right on the project
      Parameters:
      rightId - The right id
      project - The project
      Returns:
      true if has right
    • hasReadAccess

      public boolean hasReadAccess(Project project)
      Test if the current user has a read access on the project
      Parameters:
      project - The project
      Returns:
      true if has read access
    • hasRight

      public boolean hasRight(String rightId, ExplorerNode explorerNode)
      Test if the current user has the right on an explorer node
      Parameters:
      rightId - The right id
      explorerNode - The explorer node
      Returns:
      true if has right