Class AgendaEventSpaceScopeResolver

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

@Service("agendaEventSpaceScopeResolver") @Profile("mcp-server") public class AgendaEventSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space an agenda event belongs to, for the space scope of the agenda tools that reach an event by its id: the space that owns the calendar the event is in. The rule is one for every scoped tool: an event belongs to the space that owns its calendar, and a space that is only invited does not own it, so the scoped listing and the scoped search keep the same events as this resolver. An event of a personal calendar belongs to no space, and so does one of a calendar whose owner is gone, and a missing event. The event's attendees play no part: an event of a space calendar that invites people from outside is still that space's, and an event of a personal calendar that invites a space is still no space's. Read as the system, for the space scope decision only.
  • Field Summary

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

    Constructors
    Constructor
    Description
    AgendaEventSpaceScopeResolver(org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    canEdit(String objectId, String userName)
    Tells whether a person could edit the event in person, by the agenda's own rule (AgendaEventService.canUpdateEvent(Event, long)): its creator, an attendee the event lets edit it, an editor of its calendar, or a person it is shared with for edit.
     
    spaceOf(String objectId)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AgendaEventSpaceScopeResolver

      @Autowired public AgendaEventSpaceScopeResolver(org.exoplatform.agenda.service.AgendaEventService agendaEventService, org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService)
      Parameters:
      agendaEventService - reads the event
      agendaCalendarService - reads the calendar of the event
      identityManager - reads the owner of the calendar
      spaceService - reads the space the owner stands for
  • Method Details

    • getName

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

      public Long spaceOf(String objectId)
      Specified by:
      spaceOf in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the event id
      Returns:
      the id of the space that owns the event's calendar, or null for an event of a personal calendar, a missing event, calendar, owner or space, an id that isn't one, or a lookup that fails
    • canEdit

      public Boolean canEdit(String objectId, String userName)
      Tells whether a person could edit the event in person, by the agenda's own rule (AgendaEventService.canUpdateEvent(Event, long)): its creator, an attendee the event lets edit it, an editor of its calendar, or a person it is shared with for edit.
      Specified by:
      canEdit in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the event id
      userName - the person a digital worker would change the event for
      Returns:
      true when the person could edit the event; false for a missing event, a person with no identity, an id that isn't one, or a lookup that fails