org.sakaiproject.tool.calendar
Class CalendarAction.CalendarPermissions

java.lang.Object
  extended byorg.sakaiproject.tool.calendar.CalendarAction.CalendarPermissions
Enclosing class:
CalendarAction

public static class CalendarAction.CalendarPermissions
extends Object

Utility class to figure out permissions for a calendar object.


Method Summary
static boolean allowCreateEvents(String primaryCalendarReference, String selectedCalendarReference)
          Returns true if the current user is allowed to create events on the calendar id passed in as the selectedCalendarReference parameter.
static boolean allowDeleteEvent(String primaryCalendarReference, String selectedCalendarReference, String eventId)
          Returns true if the current user is allowed to delete events on the calendar id passed in as the selectedCalendarReference parameter.
static boolean allowImport(String calendarReference)
          Returns true if the use is allowed to import events into the calendar.
static boolean allowMergeCalendars(String calendarReference, boolean isOnWorkspaceTab)
          Returns true if the user is allowed to merge events from different calendars within the default channel.
static boolean allowModifyCalendarProperties(String calendarReference)
          Returns true if the use is allowed to modify properties of the calendar itself, and not just the events within the calendar.
static boolean allowReviseEvents(String primaryCalendarReference, String selectedCalendarReference, String eventId)
          Returns true if the current user is allowed to revise events on the calendar id passed in as the selectedCalendarReference parameter.
static boolean allowViewEvents(String calendarReference)
          Returns true if the current user can see the events in a calendar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

allowViewEvents

public static boolean allowViewEvents(String calendarReference)
Returns true if the current user can see the events in a calendar.


allowDeleteEvent

public static boolean allowDeleteEvent(String primaryCalendarReference,
                                       String selectedCalendarReference,
                                       String eventId)
Returns true if the current user is allowed to delete events on the calendar id passed in as the selectedCalendarReference parameter. The selected calendar must match the primary calendar for this function to return true.

Parameters:
primaryCalendarReference - calendar id for the default channel
selectedCalendarReference - calendar id for the event the user has just selected

allowReviseEvents

public static boolean allowReviseEvents(String primaryCalendarReference,
                                        String selectedCalendarReference,
                                        String eventId)
Returns true if the current user is allowed to revise events on the calendar id passed in as the selectedCalendarReference parameter. The selected calendar must match the primary calendar for this function to return true.

Parameters:
primaryCalendarReference - calendar id for the default channel
selectedCalendarReference - calendar reference for the event the user has just selected

allowCreateEvents

public static boolean allowCreateEvents(String primaryCalendarReference,
                                        String selectedCalendarReference)
Returns true if the current user is allowed to create events on the calendar id passed in as the selectedCalendarReference parameter. The selected calendar must match the primary calendar for this function to return true.

Parameters:
primaryCalendarReference - calendar reference for the default channel
selectedCalendarReference - calendar reference for the event the user has just selected

allowMergeCalendars

public static boolean allowMergeCalendars(String calendarReference,
                                          boolean isOnWorkspaceTab)
Returns true if the user is allowed to merge events from different calendars within the default channel.


allowModifyCalendarProperties

public static boolean allowModifyCalendarProperties(String calendarReference)
Returns true if the use is allowed to modify properties of the calendar itself, and not just the events within the calendar.


allowImport

public static boolean allowImport(String calendarReference)
Returns true if the use is allowed to import events into the calendar.