nextcloud-files icon indicating copy to clipboard operation
nextcloud-files copied to clipboard

Wrong permissions or missing WRITE permission

Open susnux opened this issue 5 months ago • 2 comments

  • Originally reported by @juliusknorr in https://github.com/nextcloud/server/issues/53041

When parsing the permissions we only provide the Nextcloud storage permissions:

  • readable
  • updatable
  • deletable
  • createable
  • shareable

But DAV also has writeable as a separate permission for files because updatable as in the NV DAV permission just means the node can be moved or renamed (metadata update) but it does not mean the content is updatable. So we should maybe add a dedicated writable to the permissions or add a new flag for it on the node.

Ref for permission string: https://github.com/nextcloud/server/blob/dae7c159f728a90ffa53247d6e033abdae5d2bd6/lib/public/Files/DavUtil.php#L36

Here we have:

  • NV -> The file or folder can be renamed (moved)
  • G -> The file or folder can be read
  • R -> The file or folder can be shared
  • D -> The file or folder can be deleted
  • W -> File only the file can be updated (write)
  • CK -> Folder only new children can be created

susnux avatar Aug 16 '25 20:08 susnux

IMHO we should change our parsing for the update permission to:

  • if is folder and contains CK
  • if is file and contains W

The NV permission part is only for if it can be renamed which we could provide as e.g. canBeMoved or similar. Or we add a new permission MOVEABLE = 32 to the permissions enum for it?

susnux avatar Aug 16 '25 20:08 susnux

As a workaround I used node.attributes['share-permissions'] for now which returns the backend bit flag value

juliusknorr avatar Nov 13 '25 09:11 juliusknorr