101 foreach ($this->privileges as $ace) {
127 echo
"<tr><th>Principal</th><th>Privilege</th><th></th></tr>";
128 foreach ($this->privileges as $privilege) {
132 if ($privilege[
'principal'][0] ===
'{') {
133 echo
'<td>',
$html->xmlName($privilege[
'principal']),
'</td>';
135 echo
'<td>',
$html->link($privilege[
'principal']),
'</td>';
137 echo
'<td>',
$html->xmlName($privilege[
'privilege']),
'</td>';
139 if (!empty($privilege[
'protected'])) echo
'(protected)';
145 return ob_get_clean();
173 '{DAV:}ace' =>
'Sabre\Xml\Element\KeyValue',
174 '{DAV:}privilege' =>
'Sabre\Xml\Element\Elements',
175 '{DAV:}principal' =>
'Sabre\DAVACL\Xml\Property\Principal',
180 foreach ((array)
$reader->parseInnerTree($elementMap) as $element) {
182 if ($element[
'name'] !==
'{DAV:}ace') {
185 $ace = $element[
'value'];
187 if (empty($ace[
'{DAV:}principal'])) {
190 $principal = $ace[
'{DAV:}principal'];
192 switch ($principal->getType()) {
194 $principal = $principal->getHref();
197 $principal =
'{DAV:}authenticated';
200 $principal =
'{DAV:}unauthenticated';
203 $principal =
'{DAV:}all';
208 $protected = array_key_exists(
'{DAV:}protected', $ace);
210 if (!isset($ace[
'{DAV:}grant'])) {
213 foreach ($ace[
'{DAV:}grant'] as $elem) {
214 if ($elem[
'name'] !==
'{DAV:}privilege') {
218 foreach ($elem[
'value'] as $priv) {
220 'principal' => $principal,
221 'protected' => $protected,
222 'privilege' => $priv,
245 switch ($ace[
'principal']) {
246 case '{DAV:}authenticated' :
249 case '{DAV:}unauthenticated' :
266 $writer->endElement();
267 $writer->endElement();
269 if (!empty($ace[
'protected'])) {
273 $writer->endElement();
An exception for terminatinating execution or to throw for unit testing.
This class represents the {DAV:}acl property.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
xmlSerialize(Writer $writer)
The xmlSerialize method is called during xml writing.
serializeAce(Writer $writer, array $ace)
Serializes a single access control entry.
toHtml(HtmlOutputHelper $html)
Generate html representation for this value.
__construct(array $privileges, $prefixBaseUrl=true)
Constructor.
getPrivileges()
Returns the list of privileges for this property.
const UNAUTHENTICATED
To specify a not-logged-in user, use the UNAUTHENTICATED principal.
const ALL
Everybody, basically.
const HREF
Specific principals can be specified with the HREF.
const AUTHENTICATED
To specify any principal that is logged in, use AUTHENTICATED.
This class provides a few utility functions for easily generating HTML for the browser plugin.
The Reader class expands upon PHP's built-in XMLReader.
writeElement($name, $content=null)
Write a full element tag and it's contents.
startElement($name)
Opens a new element.
WebDAV properties that implement this interface are able to generate their own html output for the br...
This is the XML element interface.