Class CalendarShareAccess
AgendaCalendarShareService (EXO-90357).
AgendaCalendarServiceImpl and AgendaEventServiceImpl are
Kernel components built from configuration.xml; the share service is
a Spring bean, exported to the Kernel by the bridge once its context is up.
A constructor dependency is impossible in that direction, so the bean is
looked up the first time it is needed, as AgendaEventReminderServiceImpl
looks up the calendar service.
Absent means not shared, never allowed. Every answer here widens an
ACL: a lookup that fails, a bean that is not there yet, an exception inside
it, all read as "no share", so that nothing this class cannot establish ever
lets a reader through. Since EXO-90378 the same rule carries the level: a
level that cannot be established is no level at all — null, not
CalendarShareLevel.VIEW — so an unreachable share service admits no
reader and, a fortiori, no writer.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilds a lookup that resolves the bean on first use.CalendarShareAccess(org.exoplatform.agenda.service.AgendaCalendarShareService calendarShareService) Builds a lookup over a known service, for tests and for the Spring side. -
Method Summary
Modifier and TypeMethodDescriptiongetSharedCalendarIds(long identityId) The calendars shared with an identity.booleanisSharedForEditWith(long calendarId, long identityId) Whether a calendar is shared with an identity at the level that lets them write events in it.booleanisSharedWith(long calendarId, long identityId) Whether a calendar is shared with an identity.org.exoplatform.agenda.constant.CalendarShareLevellevelOf(long calendarId, long identityId) The level a calendar is shared with an identity at (EXO-90378).levelsOf(long identityId) Every calendar shared with an identity and the level of each (EXO-90378): what a listing asks once instead of asking per event.
-
Constructor Details
-
CalendarShareAccess
public CalendarShareAccess()Builds a lookup that resolves the bean on first use.
-
-
Method Details
-
levelOf
public org.exoplatform.agenda.constant.CalendarShareLevel levelOf(long calendarId, long identityId) The level a calendar is shared with an identity at (EXO-90378).- Parameters:
calendarId- technical identifier of the calendaridentityId- identity identifier of the reader- Returns:
- the level, or null when the calendar is not shared with them or the share service cannot say
-
levelsOf
Every calendar shared with an identity and the level of each (EXO-90378): what a listing asks once instead of asking per event.- Parameters:
identityId- identity identifier of the reader- Returns:
- the levels by calendar identifier, empty when none or when they cannot be read