class Tilia::CalDav::Principal::ProxyWrite

ProxyWrite principal

This class represents a principal group, hosted under the main principal. This is needed to implement 'Calendar delegation' support. This class is instantiated by User.

Public Class Methods

new(principal_backend, principal_info) click to toggle source

Creates the object

Note that you MUST supply the parent principal information.

@param DAVACLPrincipalBackendBackendInterface principal_backend @param array principal_info

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 30
def initialize(principal_backend, principal_info)
  @principal_info = principal_info
  @principal_backend = principal_backend
end

Public Instance Methods

alternate_uri_set() click to toggle source

Returns a list of alternative urls for a principal

This can for example be an email address, or ldap url.

@return array

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 71
def alternate_uri_set
  []
end
delete() click to toggle source

Deletes the current node

@throws DAVExceptionForbidden @return void

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 53
def delete
  fail Dav::Exception::Forbidden, 'Permission denied to delete node'
end
display_name() click to toggle source

Returns the displayname

This should be a human readable name for the principal. If none is available, return the nodename.

@return string

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 121
def display_name
  name
end
group_member_set() click to toggle source

Returns the list of group members

If this principal is a group, this function should return all member principal uri's for the group.

@return array

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 88
def group_member_set
  @principal_backend.group_member_set(principal_url)
end
group_member_set=(principals) click to toggle source

Sets a list of group members

If this principal is a group, this method sets all the group members. The list of members is always overwritten, never appended to.

This method should throw an exception if the members could not be set.

@param array principals @return void

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 111
def group_member_set=(principals)
  @principal_backend.update_group_member_set(principal_url, principals)
end
group_membership() click to toggle source

Returns the list of groups this principal is member of

If this principal is a member of a (list of) groups, this function should return a list of principal uri's for it's members.

@return array

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 98
def group_membership
  @principal_backend.group_membership(principal_url)
end
last_modified() click to toggle source

Returns the last modification time

@return null

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 45
def last_modified
  nil
end
name() click to toggle source

Returns this principals name.

@return string

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 38
def name
  'calendar-proxy-write'
end
name=(_name) click to toggle source

Renames the node

@throws DAVExceptionForbidden @param string name The new name @return void

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 62
def name=(_name)
  fail Dav::Exception::Forbidden, 'Permission denied to rename file'
end
principal_url() click to toggle source

Returns the full principal url

@return string

# File lib/tilia/cal_dav/principal/proxy_write.rb, line 78
def principal_url
  @principal_info['uri'] + '/' + name
end