feat: add EditorLitePlus sharing role (edit without delete)#2841
feat: add EditorLitePlus sharing role (edit without delete)#2841flash7777 wants to merge 1 commit into
Conversation
Add a new sharing role "EditorLitePlus" that grants all editor permissions (view, download, upload, edit, add, move) except delete. This role fills a gap between EditorLite (upload only) and Editor (full edit including delete) for use cases where users need to work with documents but should not be able to delete them, e.g. shared project folders or document management scenarios. Permissions: Read, Write, Create, Move. Explicitly excluded: Delete, PurgeRecycle, ListRecycle, RestoreRecycleItem.
ContextWe are developing an EDMS (Electronic Document Management System) layer on top of OpenCloud for German municipalities. A recurring requirement is that users should be able to work freely with documents β create, edit, upload β but not delete them. Deletion should be reserved for managers or administrators. Today, the only option is the full Editor role which includes delete, or EditorLite which lacks the ability to edit existing files. There is no middle ground. EditorLitePlus fills exactly this gap. It is a minimal, non-breaking addition that reuses existing CS3 permissions. No proto changes, no new APIs β just a new combination of existing permission flags. We see this as useful beyond our EDMS project: shared team folders, student workspaces, compliance-driven environments β anywhere where "edit yes, delete no" is the desired policy. |
Up to standards βπ’ Issues
|
| Metric | Results |
|---|---|
| Complexity | 111 |
| Duplication | 40 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Summary
Adds a new sharing role EditorLitePlus that grants all editor permissions except delete.
Motivation
There is currently a gap between the existing sharing roles:
EditorLite allows uploading but not editing existing files. Editor allows everything including deletion. There is no role that lets users fully edit and create content while preventing deletion.
This is needed for shared project folders, document management scenarios and compliance use cases where accidental or unauthorized deletion must be prevented.
Changes
vendor/.../reva/v2/pkg/conversions/role.go: AddRoleEditorLitePlusconstant andNewEditorLitePlusRole()services/graph/pkg/unifiedrole/roles.go: Add role definition (weight 55, between EditorLite and Editor)services/graph/pkg/unifiedrole/conversion.go: Add display name mappingDetails
Uses only existing CS3 ResourcePermissions β no proto changes needed.
Explicitly excluded:
Delete,PurgeRecycle,ListRecycle,RestoreRecycleItem.Overwriting existing files is allowed (uses
InitiateFileUpload, notDelete). Old versions are preserved as revisions.Enabled by default.
Test plan