ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
HomeCollection.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAVACL\FS;
4
6use Sabre\DAVACL\ACLTrait;
9use Sabre\Uri;
10
23
24 use ACLTrait;
25
31 public $collectionName = 'home';
32
38 protected $storagePath;
39
48
49 parent::__construct($principalBackend, $principalPrefix);
50 $this->storagePath = $storagePath;
51
52 }
53
61 function getName() {
62
64
65 }
66
77 function getChildForPrincipal(array $principalInfo) {
78
79 $owner = $principalInfo['uri'];
80 $acl = [
81 [
82 'privilege' => '{DAV:}all',
83 'principal' => '{DAV:}owner',
84 'protected' => true,
85 ],
86 ];
87
88 list(, $principalBaseName) = Uri\split($owner);
89
90 $path = $this->storagePath . '/' . $principalBaseName;
91
92 if (!is_dir($path)) {
93 mkdir($path, 0777, true);
94 }
95 return new Collection(
96 $path,
97 $acl,
98 $owner
99 );
100
101 }
102
103
116 function getACL() {
117
118 return [
119 [
120 'principal' => '{DAV:}authenticated',
121 'privilege' => '{DAV:}read',
122 'protected' => true,
123 ]
124 ];
125
126 }
127
128}
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
This is an ACL-enabled collection.
Definition: Collection.php:18
This collection contains a collection for every principal.
getACL()
Returns a list of ACE's for this node.
__construct(BackendInterface $principalBackend, $storagePath, $principalPrefix='principals')
Creates the home collection.
getChildForPrincipal(array $principalInfo)
Returns a principals' collection of files.
getName()
Returns the name of the node.
ACL-enabled node.
Definition: IACL.php:16
Implement this interface to create your own principal backends.
split($path)
Returns the 'dirname' and 'basename' for a path.
Definition: functions.php:279