class Tilia::DavAcl::PrincipalBackend::AbstractBackend
Abstract Principal
Backend
Currently this class has no function. It's here for consistency and so we have a non-bc-breaking way to add a default generic implementation to functions we may add in the future.
Public Instance Methods
find_by_uri(uri, principal_prefix)
click to toggle source
Finds a principal by its URI.
This method may receive any type of uri, but mailto: addresses will be the most common.
Implementation of this API is optional. It is currently used by the CalDAV system to find principals based on their email addresses. If this API is not implemented, some features may not work correctly.
This method must return a relative principal path, or null, if the principal was not found or you refuse to find it.
@param string uri @param string principal_prefix @return string
# File lib/tilia/dav_acl/principal_backend/abstract_backend.rb, line 27 def find_by_uri(uri, principal_prefix) # Note that the default implementation here is a bit slow and could # likely be optimized. return nil unless uri[0, 7] == 'mailto:' result = search_principals( principal_prefix, '{http://sabredav.org/ns}email-address' => uri[7..-1] ) result[0] end