Class ProcessSpaceScopeResolver

java.lang.Object
org.exoplatform.processes.mcp.ProcessSpaceScopeResolver
All Implemented Interfaces:
io.meeds.mcp.server.plugin.SpaceScopeResolver

@Service("processSpaceScopeResolver") @Profile("mcp-server") public class ProcessSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a process (a workflow) belongs to, for the space scope of the processes tools: the space of the process's project, when every manager of that project is a role of one and the same space group (<role>:/spaces/<name>), the rule of the task add-on's project resolver. A project with a user manager, a group outside the spaces or a second space among its managers, a missing process, project or space belong to no space. The process is read as the system (null user id), for its project id only, never for an authorization flag: the tools read the process again with the caller's memberships and gate on its acl. The read gives a project id only, never returned to the model, since a space scope decision needs the space of any process, whoever asks. Its only visible effect is that a process id outside the call's space is refused by the scope, and one inside it that the caller may not submit to, by the tool's own check.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name the processes tools' space_scope.resolver gives.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProcessSpaceScopeResolver(org.exoplatform.processes.service.ProcessesService processesService, org.exoplatform.task.service.ProjectService projectService, org.exoplatform.social.core.space.spi.SpaceService spaceService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    spaceOf(String objectId)
     
    spaceOfProject(long projectId)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.meeds.mcp.server.plugin.SpaceScopeResolver

    canEdit
  • Field Details

  • Constructor Details

    • ProcessSpaceScopeResolver

      public ProcessSpaceScopeResolver(org.exoplatform.processes.service.ProcessesService processesService, org.exoplatform.task.service.ProjectService projectService, org.exoplatform.social.core.space.spi.SpaceService spaceService)
      Parameters:
      processesService - reads the process
      projectService - reads the process's project
      spaceService - reads the space of a group
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Returns:
      "process"
    • spaceOf

      public Long spaceOf(String objectId)
      Specified by:
      spaceOf in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the process (workflow) id
      Returns:
      the id of the space of the process's project, or null for a project that isn't managed through exactly one space, a missing process, project or space, an id that isn't one, or a lookup that fails
    • spaceOfProject

      public Long spaceOfProject(long projectId)
      Parameters:
      projectId - the id of a process project
      Returns:
      the id of the space whose group all the project's managers are roles of, else null: any manager that is a user, a group outside the spaces or a role of another group gives none, and so does a missing project, a zero id included