public function getSupportedPrivilegeSet($node)
    {
        if (is_string($node)) {
            $node = $this->server->tree->getNodeForPath($node);
        }

        $supportedPrivileges = null;
        if ($node instanceof IACL) {
            $supportedPrivileges = $node->getSupportedPrivilegeSet();
        }

        if (is_null($supportedPrivileges)) {
            // Default
            $supportedPrivileges = [
                '{DAV:}read' => [
                    'abstract' => false,
                    'aggregates' => [
                        '{DAV:}read-acl' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}read-current-user-privilege-set' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                    ],
                ],
                '{DAV:}write' => [
                    'abstract' => false,
                    'aggregates' => [
                        '{DAV:}write-properties' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}write-content' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}unlock' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                    ],
                ],
            ];
            if ($node instanceof DAV\ICollection) {
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}bind'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}unbind'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
            }
            if ($node instanceof IACL) {
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}write-acl'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
            }
        }

        $this->server->emit(
            'getSupportedPrivilegeSet',
            [$node, &$supportedPrivileges]
        );

        return $supportedPrivileges;
    }
public function getSupportedPrivilegeSet($node)
    {
        if (is_string($node)) {
            $node = $this->server->tree->getNodeForPath($node);
        }

        $supportedPrivileges = null;
        if ($node instanceof IACL) {
            $supportedPrivileges = $node->getSupportedPrivilegeSet();
        }

        if (is_null($supportedPrivileges)) {
            // Default
            $supportedPrivileges = [
                '{DAV:}read' => [
                    'abstract' => false,
                    'aggregates' => [
                        '{DAV:}read-acl' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}read-current-user-privilege-set' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                    ],
                ],
                '{DAV:}write' => [
                    'abstract' => false,
                    'aggregates' => [
                        '{DAV:}write-properties' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}write-content' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                        '{DAV:}unlock' => [
                            'abstract' => false,
                            'aggregates' => [],
                        ],
                    ],
                ],
            ];
            if ($node instanceof DAV\ICollection) {
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}bind'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}unbind'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
            }
            if ($node instanceof IACL) {
                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}write-acl'] = [
                    'abstract' => false,
                    'aggregates' => [],
                ];
            }
        }

        $this->server->emit(
            'getSupportedPrivilegeSet',
            [$node, &$supportedPrivileges]
        );

        return $supportedPrivileges;
    }
public function getSupportedPrivilegeSet ( $ node ) { if ( is_string ( $ node ) ) { $ node = $ this -> server -> tree -> getNodeForPath ( $ node ) ; } $ supportedPrivileges = null ; if ( $ node instanceof IACL ) { $ supportedPrivileges = $ node -> getSupportedPrivilegeSet ( ) ; } if ( is_null ( $ supportedPrivileges ) ) { // Default $ supportedPrivileges = [ '{DAV:}read' => [ 'abstract' => false , 'aggregates' => [ '{DAV:}read-acl' => [ 'abstract' => false , 'aggregates' => [ ] , ] , '{DAV:}read-current-user-privilege-set' => [ 'abstract' => false , 'aggregates' => [ ] , ] , ] , ] , '{DAV:}write' => [ 'abstract' => false , 'aggregates' => [ '{DAV:}write-properties' => [ 'abstract' => false , 'aggregates' => [ ] , ] , '{DAV:}write-content' => [ 'abstract' => false , 'aggregates' => [ ] , ] , '{DAV:}unlock' => [ 'abstract' => false , 'aggregates' => [ ] , ] , ] , ] , ] ; if ( $ node instanceof DAV \ ICollection ) { $ supportedPrivileges [ '{DAV:}write' ] [ 'aggregates' ] [ '{DAV:}bind' ] = [ 'abstract' => false , 'aggregates' => [ ] , ] ; $ supportedPrivileges [ '{DAV:}write' ] [ 'aggregates' ] [ '{DAV:}unbind' ] = [ 'abstract' => false , 'aggregates' => [ ] , ] ; } if ( $ node instanceof IACL ) { $ supportedPrivileges [ '{DAV:}write' ] [ 'aggregates' ] [ '{DAV:}write-acl' ] = [ 'abstract' => false , 'aggregates' => [ ] , ] ; } } $ this -> server -> emit ( 'getSupportedPrivilegeSet' , [ $ node , & $ supportedPrivileges ] ) ; return $ supportedPrivileges ; }
Returns a tree of supported privileges for a resource.

The returned array structure should be in this form:

[
[
'privilege' => '{DAV:}read',
'abstract'  => false,
'aggregates' => []
]
]

Privileges can be nested using "aggregates". Doing so means that
if you assign someone the aggregating privilege, all the
sub-privileges will automatically be granted.

Marking a privilege as abstract means that the privilege cannot be
directly assigned, but must be assigned via the parent privilege.

So a more complex version might look like this:

[
[
'privilege' => '{DAV:}read',
'abstract'  => false,
'aggregates' => [
[
'privilege'  => '{DAV:}read-acl',
'abstract'   => false,
'aggregates' => [],
]
]
]
]

@param string|INode $node

@return array
Returns a tree of supported privileges for a resource .