public function propPatch($path, DAV\PropPatch $propPatch)
    {
        $node = $this->server->tree->getNodeForPath($path);
        if (!$node instanceof ISharedCalendar) {
            return;
        }

        if (\Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER === $node->getShareAccess() || \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED === $node->getShareAccess()) {
            $propPatch->handle('{DAV:}resourcetype', function ($value) use ($node) {
                if ($value->is('{'.Plugin::NS_CALENDARSERVER.'}shared-owner')) {
                    return false;
                }
                $shares = $node->getInvites();
                foreach ($shares as $share) {
                    $share->access = DAV\Sharing\Plugin::ACCESS_NOACCESS;
                }
                $node->updateInvites($shares);

                return true;
            });
        }
    }
public function propPatch($path, DAV\PropPatch $propPatch)
    {
        $node = $this->server->tree->getNodeForPath($path);
        if (!$node instanceof ISharedCalendar) {
            return;
        }

        if (\Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER === $node->getShareAccess() || \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED === $node->getShareAccess()) {
            $propPatch->handle('{DAV:}resourcetype', function ($value) use ($node) {
                if ($value->is('{'.Plugin::NS_CALENDARSERVER.'}shared-owner')) {
                    return false;
                }
                $shares = $node->getInvites();
                foreach ($shares as $share) {
                    $share->access = DAV\Sharing\Plugin::ACCESS_NOACCESS;
                }
                $node->updateInvites($shares);

                return true;
            });
        }
    }
public function propPatch ( $ path , DAV \ PropPatch $ propPatch ) { $ node = $ this -> server -> tree -> getNodeForPath ( $ path ) ; if ( ! $ node instanceof ISharedCalendar ) { return ; } if ( \ Sabre \ DAV \ Sharing \ Plugin :: ACCESS_SHAREDOWNER === $ node -> getShareAccess ( ) || \ Sabre \ DAV \ Sharing \ Plugin :: ACCESS_NOTSHARED === $ node -> getShareAccess ( ) ) { $ propPatch -> handle ( '{DAV:}resourcetype' , function ( $ value ) use ( $ node ) { if ( $ value -> is ( '{' . Plugin :: NS_CALENDARSERVER . '}shared-owner' ) ) { return false ; } $ shares = $ node -> getInvites ( ) ; foreach ( $ shares as $ share ) { $ share -> access = DAV \ Sharing \ Plugin :: ACCESS_NOACCESS ; } $ node -> updateInvites ( $ shares ) ; return true ; } ) ; } }
This method is trigged when a user attempts to update a node's
properties.

A previous draft of the sharing spec stated that it was possible to use
PROPPATCH to remove 'shared-owner' from the resourcetype, thus unsharing
the calendar.

Even though this is no longer in the current spec, we keep this around
because OS X 10.7 may still make use of this feature.

@param string        $path
@param DAV\PropPatch $propPatch
This method is trigged when a user attempts to update a node s properties .