class Tilia::CalDav::Schedule::Outbox

The CalDAV scheduling outbox

The outbox is mainly used as an endpoint in the tree for a client to do free-busy requests. This functionality is completely handled by the Scheduling plugin, so this object is actually mostly static.

Public Class Methods

new(principal_uri) click to toggle source

Constructor

@param string principal_uri

# File lib/tilia/cal_dav/schedule/outbox.rb, line 21
def initialize(principal_uri)
  @principal_uri = principal_uri
end

Public Instance Methods

acl() click to toggle source

Returns a list of ACE's for this node.

Each ACE has the following properties:

* 'privilege', a string such as {DAV:}read or {DAV:}write. These are
  currently the only supported privileges
* 'principal', a url to the principal who owns the node
* 'protected' (optional), indicating that this ACE is not allowed to
   be updated.

@return array

# File lib/tilia/cal_dav/schedule/outbox.rb, line 69
def acl
  [
    {
      'privilege' => "{#{Plugin::NS_CALDAV}}schedule-query-freebusy",
      'principal' => owner,
      'protected' => true
    },
    {
      'privilege' => "{#{Plugin::NS_CALDAV}}schedule-post-vevent",
      'principal' => owner,
      'protected' => true
    },
    {
      'privilege' => '{DAV:}read',
      'principal' => owner,
      'protected' => true
    },
    {
      'privilege' => "{#{Plugin::NS_CALDAV}}schedule-query-freebusy",
      'principal' => owner + '/calendar-proxy-write',
      'protected' => true
    },
    {
      'privilege' => "{#{Plugin::NS_CALDAV}}schedule-post-vevent",
      'principal' => owner + '/calendar-proxy-write',
      'protected' => true
    },
    {
      'privilege' => '{DAV:}read',
      'principal' => owner + '/calendar-proxy-read',
      'protected' => true
    },
    {
      'privilege' => '{DAV:}read',
      'principal' => owner + '/calendar-proxy-write',
      'protected' => true
    }
  ]
end
acl=(_acl) click to toggle source

Updates the ACL

This method will receive a list of new ACE's.

@param array acl @return void

# File lib/tilia/cal_dav/schedule/outbox.rb, line 115
def acl=(_acl)
  fail Dav::Exception::MethodNotAllowed, 'You\'re not allowed to update the ACL'
end
children() click to toggle source

Returns an array with all the child nodes

@return SabreDAVINode[]

# File lib/tilia/cal_dav/schedule/outbox.rb, line 37
def children
  []
end
group() click to toggle source

Returns a group principal

This must be a url to a principal, or null if there's no owner

@return string|null

# File lib/tilia/cal_dav/schedule/outbox.rb, line 55
def group
  nil
end
name() click to toggle source

Returns the name of the node.

This is used to generate the url.

@return string

# File lib/tilia/cal_dav/schedule/outbox.rb, line 30
def name
  'outbox'
end
owner() click to toggle source

Returns the owner principal

This must be a url to a principal, or null if there's no owner

@return string|null

# File lib/tilia/cal_dav/schedule/outbox.rb, line 46
def owner
  @principal_uri
end
supported_privilege_set() click to toggle source

Returns the list of supported privileges for this node.

The returned data structure is a list of nested privileges. See SabreDAVACLPlugin::getDefaultSupportedPrivilegeSet for a simple standard structure.

If null is returned from this method, the default privilege set is used, which is fine for most common usecases.

@return array|null

# File lib/tilia/cal_dav/schedule/outbox.rb, line 129
def supported_privilege_set
  default = DavAcl::Plugin.default_supported_privilege_set
  default['aggregates'] << {
    'privilege' => "{#{Plugin::NS_CALDAV}}schedule-query-freebusy"
  }
  default['aggregates'] << {
    'privilege' => "{#{Plugin::NS_CALDAV}}schedule-post-vevent"
  }

  default
end