Skip to content

Shared drives in admin panel#4718

Merged
shepilov merged 4 commits intomasterfrom
feat/shared-drive-in-admin-panel
Apr 8, 2026
Merged

Shared drives in admin panel#4718
shepilov merged 4 commits intomasterfrom
feat/shared-drive-in-admin-panel

Conversation

@shepilov
Copy link
Copy Markdown
Contributor

Summary

  • allow POST /sharings/drives to create a new shared drive directly
  • expose org_drive so clients can distinguish organization "shared drives"
  • track who trashed a file or folder via cozyMetadata

Changes

Add org_drive for organization-backed drives

Shared drives created from an organization instance are now marked with the org_drive flag.

This includes:

  • a new Instance.IsOrganizationInstance() helper
  • org_drive on sharing payloads
  • propagation of the flag to clients and recipients

Track trash actors in cozyMetadata

When a file or folder is moved to trash, the stack now stores:

  • trashedAt
  • trashedBy

trashedBy is typed and currently supports:

  • kind: "member"
  • kind: "anonymous-share"

For member actors, the payload also includes:

  • displayName
  • domain

This metadata is resolved in middleware and then written by the files layer, so the metadata is preserved across normal access, shared-drive access, and replication flows.

@shepilov shepilov requested a review from a team as a code owner March 31, 2026 14:07
@shepilov shepilov force-pushed the feat/shared-drive-in-admin-panel branch from 06ca1b5 to 8e9f8e5 Compare April 2, 2026 14:28
@Crash--
Copy link
Copy Markdown
Contributor

Crash-- commented Apr 7, 2026

are you emptying trash* metadata when the user restaure the file?

@Crash--
Copy link
Copy Markdown
Contributor

Crash-- commented Apr 7, 2026

Once this PR is merged, update this repo please https://github.com/cozy/cozy-doctypes since we're updating a "lot" the io.cozy.files doctype.

@shepilov
Copy link
Copy Markdown
Contributor Author

shepilov commented Apr 7, 2026

are you emptying trash* metadata when the user restaure the file?

nope, it will stay there until it is overwritten during the next "delete".

Comment thread web/sharings/drives.go Outdated
Comment thread web/sharings/move_test.go
@shepilov shepilov force-pushed the feat/shared-drive-in-admin-panel branch from 6482700 to 460e3c6 Compare April 7, 2026 11:11
@shepilov shepilov merged commit 208560e into master Apr 8, 2026
4 checks passed
@shepilov shepilov deleted the feat/shared-drive-in-admin-panel branch April 8, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants