public function shareResource($path, array $sharees)
    {
        $node = $this->server->tree->getNodeForPath($path);

        if (!$node instanceof ISharedNode) {
            throw new Forbidden('Sharing is not allowed on this node');
        }

        // Getting ACL info
        $acl = $this->server->getPlugin('acl');

        // If there's no ACL support, we allow everything
        if ($acl) {
            $acl->checkPrivileges($path, '{DAV:}share');
        }

        foreach ($sharees as $sharee) {
            // We're going to attempt to get a local principal uri for a share
            // href by emitting the getPrincipalByUri event.
            $principal = null;
            $this->server->emit('getPrincipalByUri', [$sharee->href, &$principal]);
            $sharee->principal = $principal;
        }
        $node->updateInvites($sharees);
    }
public function shareResource($path, array $sharees)
    {
        $node = $this->server->tree->getNodeForPath($path);

        if (!$node instanceof ISharedNode) {
            throw new Forbidden('Sharing is not allowed on this node');
        }

        // Getting ACL info
        $acl = $this->server->getPlugin('acl');

        // If there's no ACL support, we allow everything
        if ($acl) {
            $acl->checkPrivileges($path, '{DAV:}share');
        }

        foreach ($sharees as $sharee) {
            // We're going to attempt to get a local principal uri for a share
            // href by emitting the getPrincipalByUri event.
            $principal = null;
            $this->server->emit('getPrincipalByUri', [$sharee->href, &$principal]);
            $sharee->principal = $principal;
        }
        $node->updateInvites($sharees);
    }
public function shareResource ( $ path , array $ sharees ) { $ node = $ this -> server -> tree -> getNodeForPath ( $ path ) ; if ( ! $ node instanceof ISharedNode ) { throw new Forbidden ( 'Sharing is not allowed on this node' ) ; } // Getting ACL info $ acl = $ this -> server -> getPlugin ( 'acl' ) ; // If there's no ACL support, we allow everything if ( $ acl ) { $ acl -> checkPrivileges ( $ path , '{DAV:}share' ) ; } foreach ( $ sharees as $ sharee ) { // We're going to attempt to get a local principal uri for a share // href by emitting the getPrincipalByUri event. $ principal = null ; $ this -> server -> emit ( 'getPrincipalByUri' , [ $ sharee -> href , & $ principal ] ) ; $ sharee -> principal = $ principal ; } $ node -> updateInvites ( $ sharees ) ; }
Updates the list of sharees on a shared resource.

The sharees  array is a list of people that are to be added modified
or removed in the list of shares.

@param string   $path
@param Sharee[] $sharees
Updates the list of sharees on a shared resource .