ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Collection.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAVACL\FS;
4 
7 use Sabre\DAV\FSExt\Directory as BaseCollection;
10 
18 class Collection extends BaseCollection implements IACL {
19 
20  use ACLTrait;
21 
27  protected $acl;
28 
34  protected $owner;
35 
43  function __construct($path, array $acl, $owner = null) {
44 
45  parent::__construct($path);
46  $this->acl = $acl;
47  $this->owner = $owner;
48 
49  }
50 
61  function getChild($name) {
62 
63  $path = $this->path . '/' . $name;
64 
65  if (!file_exists($path)) throw new NotFound('File could not be located');
66  if ($name == '.' || $name == '..') throw new Forbidden('Permission denied to . and ..');
67 
68  if (is_dir($path)) {
69 
70  return new self($path, $this->acl, $this->owner);
71 
72  } else {
73 
74  return new File($path, $this->acl, $this->owner);
75 
76  }
77 
78  }
79 
87  function getOwner() {
88 
89  return $this->owner;
90 
91  }
92 
105  function getACL() {
106 
107  return $this->acl;
108 
109  }
110 
111 }
__construct($path, array $acl, $owner=null)
Constructor.
Definition: Collection.php:43
This is an ACL-enabled collection.
Definition: Collection.php:18
getOwner()
Returns the owner principal.
Definition: Collection.php:87
getACL()
Returns a list of ACE&#39;s for this node.
Definition: Collection.php:105
getChild($name)
Returns a specific child node, referenced by its name.
Definition: Collection.php:61
ACL-enabled node.
Definition: IACL.php:16
Directory class.
Definition: Directory.php:15