Class ActivitySpaceScopeResolver
java.lang.Object
io.meeds.mcp.server.tool.plugin.ActivitySpaceScopeResolver
- All Implemented Interfaces:
io.meeds.mcp.server.plugin.SpaceScopeResolver
@Service("activitySpaceScopeResolver")
public class ActivitySpaceScopeResolver
extends Object
implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space an activity belongs to: the space whose stream holds it.
A shared activity is a copy posted in the stream it was shared to, so it
belongs to that space, and the activity it was shared from to its own. A
comment, an activity of a user's stream and a missing one belong to no
space. Read as the system, for the space scope decision only. For a write
declaring
space_role: editor, it also tells whether a person could
edit the activity in person, by social's own rule.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTells whether a person could change the activity in person, as social decides it for the post's own edit, image and publish actions (ActivityManager.isActivityEditable(ExoSocialActivity, Identity)): by default its poster, or, for a post scheduled for later, whoever may manage the space's content; an activity type's own plugin, and the platform's edit setting, decide first.getName()
-
Field Details
-
NAME
-
-
Constructor Details
-
ActivitySpaceScopeResolver
public ActivitySpaceScopeResolver()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceio.meeds.mcp.server.plugin.SpaceScopeResolver- Returns:
- "activity"
-
spaceOf
- Specified by:
spaceOfin interfaceio.meeds.mcp.server.plugin.SpaceScopeResolver- Parameters:
objectId- the activity id- Returns:
- the id of the space whose stream holds the activity, or null for a comment, a user stream's activity, a missing activity, an id that isn't one, or a lookup that fails
-
canEdit
Tells whether a person could change the activity in person, as social decides it for the post's own edit, image and publish actions (ActivityManager.isActivityEditable(ExoSocialActivity, Identity)): by default its poster, or, for a post scheduled for later, whoever may manage the space's content; an activity type's own plugin, and the platform's edit setting, decide first.- Specified by:
canEditin interfaceio.meeds.mcp.server.plugin.SpaceScopeResolver- Parameters:
objectId- the activity iduserName- the person a digital worker would change the activity for- Returns:
- true when the person could change it; false for a comment, a missing activity, a deleted or disabled person, or a lookup that fails
-