Class WorkRequestSpaceScopeResolver

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

@Service("workRequestSpaceScopeResolver") @Profile("mcp-server") public class WorkRequestSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a work request belongs to, for the space scope of the processes tools: the space of the project of the process it was submitted to, by the rule of ProcessSpaceScopeResolver. A request is a task of its process's project, so a task whose project is no process's project is no request and belongs to no space here, nor does a missing one. The request is read as the system (ProcessesService.getWorkById(long)), for its project id only; the tools read the request again with the caller's own rights (getWorkById(userIdentityId, id), the caller's own requests only). The read gives a project id only, never returned to the model, since a space scope decision needs the space of any request, whoever asks. Its only visible effect is that a request id outside the call's space is refused by the scope, and one inside it that isn't the caller's, by the tool.
  • Field Details

  • Constructor Details

    • WorkRequestSpaceScopeResolver

      public WorkRequestSpaceScopeResolver(org.exoplatform.processes.service.ProcessesService processesService, ProcessSpaceScopeResolver processSpaceScopeResolver)
      Parameters:
      processesService - reads the request and the process of its project
      processSpaceScopeResolver - tells the space of a process project
  • Method Details

    • getName

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

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