[SOLVED] Groupfolder API user permission

Nextcloud version: 25

I am currently using OCC to configure permission for a specific user on a folder (inside a groupfolder):
occ groupfolders:permissions GFID --user THEUSER /pathx/THEUSER -- +read +write +delete +create -share

How can I do the same using the groupfolder API?

POST apps/groupfolders/folders/$folderId/groups/$groupId : Set the permissions a group has in a folder ← looks like only for group.


@juliushaertl @MorrisJobke @icewind You guys are my only hope of getting an answer before tring to implement it myself (and hopefully creating a PR).

Replying to myself, took way too long to find this information. We can use webdav (including group & user). Here’s a basic example:

    $propertyupdate = <<<EOD
    <?xml version="1.0"?>
    <d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">

    try {
        $this->client->request('PROPPATCH', 'https://' . config('NEXTCLOUDURL') . '/remote.php/dav/files/myuser/the/path', [
            'auth'    => ['myuser', 'password'],
            'headers' => ['Content-Type' => 'application/xml'],
            'body' => $propertyupdate
    } catch (RequestException $e) {
        $exception = $e->hasResponse() ? (string) $e->getResponse()->getBody() : $e->getMessage();
1 Like