feat: add ACL support for container-specific permissions#5628
Conversation
Extend the grants ACL encoding/decoding to support the new delete_container and move_container permission fields from CS3 APIs. New ACL flags: - +dc / !dc: delete_container allowed/denied - +mc / !mc: move_container allowed/denied This enables storage backends to distinguish between file and container (directory) delete/move operations, supporting DMS use cases like file plan (Aktenplan) structure protection. Depends on: cs3org/cs3apis#container-permissions-and-immutable Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
ContextThis PR is the Reva-side companion to the CS3 API proposal in cs3org/cs3apis#272. We are developing an EDMS layer for German municipalities (Kommunalverwaltungen) on top of OpenCloud/Reva. A core requirement is protecting hierarchical file plan structures (Aktenpläne) — rigid directory trees that must remain stable while users freely work with documents inside them. The current permission model does not distinguish between file and container operations for The changes here are intentionally minimal — just the ACL encoding/decoding layer. Storage driver implementations (e.g., decomposedfs) would add the corresponding We are happy to extend this with tests and additional driver support based on community feedback. |
|
Quick note: The commits mention "Claude" as co-author — this just means we used Claude Code (AI coding assistant) as tooling support during development. The proposal and its rationale are entirely ours, based on real requirements from our EDMS project. |
|
Hi @flash7777 , Sorry for the late reply. I also saw your pull request on the CS3APIs. Since you want to build an EDMS on top of OpenCloud, you should probably make this PR in github.com/opencloud-eu/reva. They run a fork of our Reva which has completely diverged, so your commit would not get in there. |
|
Indeed this was the plan. starting at cs3. |
|
and yes, we're still in the process of founding a World Immutable File System Flag Association. Freedom for mutable flags, immutable flags for everyone, for every file system. We're still in the founding phase — it's currently held up by several current and upcoming PRs. 🙂 |
|
and speaking of which — this Reva from OpenCloud (opencloud.eu) of course relies on importing CS3's CS3 API, which actually has to be merged and shipped first before it can be included. And I really wanted to avoid making my own fork, merging that in as the import, and then saying 'no, let's just wait for CS3.' It's all not a big deal though — that's just how it is, one thing after another, apparently, obviously. |
Summary
Extend the grants ACL encoding/decoding to support the new
delete_containerandmove_containerpermission fields proposed in cs3org/cs3apis#272.Changes
pkg/storage/utils/grants/grants.go: Add ACL flags+dc/!dc(delete_container) and+mc/!mc(move_container) to the ACL string representation+dcand+mcback to the correspondingResourcePermissionsfieldsMotivation
This enables storage backends to distinguish between file and container (directory) delete/move operations, supporting DMS use cases like file plan (Aktenplan) structure protection.
With these ACL flags, a role can be configured that allows:
Depends on
Test plan
GetACLPermencodes+dc/!dcand+mc/!mccorrectlyGetGrantPermissionSetdecodes+dcand+mccorrectlydc/mcdefault tofalse