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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWorkRequestSpaceScopeResolver(org.exoplatform.processes.service.ProcessesService processesService, ProcessSpaceScopeResolver processSpaceScopeResolver) -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.mcp.server.plugin.SpaceScopeResolver
canEdit
-
Field Details
-
NAME
-
-
Constructor Details
-
WorkRequestSpaceScopeResolver
public WorkRequestSpaceScopeResolver(org.exoplatform.processes.service.ProcessesService processesService, ProcessSpaceScopeResolver processSpaceScopeResolver) - Parameters:
processesService- reads the request and the process of its projectprocessSpaceScopeResolver- tells the space of a process project
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceio.meeds.mcp.server.plugin.SpaceScopeResolver- Returns:
- "work_request"
-
spaceOf
- Specified by:
spaceOfin interfaceio.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
-