You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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.
| 403 | Forbidden | Insufficient permissions to create a sharing |
233
265
| 404 | Not Found | The folder with the given `folder_id` does not exist |
234
-
| 409 | Conflict | The folder already has a sharing, is inside a shared folder, or contains a shared subfolder |
235
-
| 422 | Unprocessable Entity |Missing `folder_id`, folder is a file, or folder is a system folder |
266
+
| 409 | Conflict | The folder already has a sharing, is inside a shared folder, contains a shared subfolder, or the new `name` already exists in Shared Drives|
267
+
| 422 | Unprocessable Entity |Invalid request: missing both `folder_id` and `name`, both provided together, folder is a file, folder is a system folder, or the new `name` is invalid|
236
268
237
269
**Example error (folder already shared):**
238
270
@@ -737,6 +769,13 @@ drive.
737
769
#### POST /sharings/drives/trash/:file-id
738
770
#### DELETE /sharings/drives/trash/:file-id
739
771
772
+
Trash operations keep the same file metadata shape as `/files`: when an item is
773
+
moved to the trash, `cozyMetadata.trashedAt` and `cozyMetadata.trashedBy` are
774
+
exposed on both the caller side and the replicated shared-drive copies. On
775
+
shared-drive requests, `trashedBy.kind` is `member` and
776
+
`trashedBy.displayName` / `trashedBy.domain` are derived from the sharing
777
+
member linked to the `DriveToken`.
778
+
740
779
## Share-by-link permissions
741
780
742
781
The following routes manage share-by-link permissions scoped to files inside a
0 commit comments