Ejemplo n.º 1
0
 function testGetACl()
 {
     $principalBackend = new PrincipalBackend\Mock();
     $principal = new Principal($principalBackend, ['uri' => 'principals/admin']);
     $this->assertEquals([['privilege' => '{DAV:}all', 'principal' => '{DAV:}owner', 'protected' => true]], $principal->getACL());
 }
Ejemplo n.º 2
0
 public function testGetACl()
 {
     $principalBackend = new PrincipalBackend\Mock();
     $principal = new Principal($principalBackend, array('uri' => 'principals/admin'));
     $this->assertEquals(array(array('privilege' => '{DAV:}read', 'principal' => 'principals/admin', 'protected' => true)), $principal->getACL());
 }
Ejemplo n.º 3
0
 /**
  * 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
  */
 function getACL()
 {
     $acl = parent::getACL();
     $acl[] = ['privilege' => '{DAV:}read', 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-read', 'protected' => true];
     $acl[] = ['privilege' => '{DAV:}read', 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-write', 'protected' => true];
     return $acl;
 }