Admins cannot see or revoke person-to-person grants instance-wide #833

Closed
opened 2026-10-02 10:34:01 +00:00 by Cordy · 4 comments
Owner

Found during the #831 cleanup on files-bao (2026-10-02).

What happens today

  • The admin UI lists public links only (GET /api/v1/admin/links skips IsGrant()). Person-to-person grants never appear anywhere in the admin area.
  • The older GET /api/v1/admin/shares does return grants mixed with links, but no UI uses it, and its rows carry no creator.
  • DELETE /api/v1/admin/shares/{token} returns 404 for a grant id: it deletes by raw token, while grants are stored under share.GrantKey(id). It also writes no audit event (the user-side routes log share-revoke / share-grant-revoke).
  • So an admin who needs to cut a grant has to know the path and go through DELETE /api/v1/grants/{id}. That is how the #831 test grant was removed.

What competitors do

Instance-wide review and revocation of person shares, not just public links, is standard:

  • Box: Admin Console → Content Manager lists a user's content and lets the admin change or remove collaborators and shared links.
  • Google Workspace: the security investigation tool's "Audit file permissions" lists the people and groups with access and lets the admin remove them or change link sharing.
  • Dropbox: Admin console → Content → Manage access → Remove. Admins can also manage members' shared links.
  • SharePoint/OneDrive: admins remove direct access per item, plus data access governance reports.
  • Seafile: the system admin sees and deletes all share links (/sys/publinkadmin/) and can unshare libraries from the user detail page.
  • Nextcloud: core has no admin share view. That gap drew years of complaints from admins needing compliance and GDPR reviews (nextcloud/server#5586, closed with a pointer to an app). It is now covered by the official Share Review app, which reviews every share type, removes shares, and exports CSV/PDF.

Proposed scope

  1. The server returns grants in the admin list with owner, addressee (kind + name), role, path, created and expiry, and revokes them by id. Every admin revoke writes an audit event naming the acting admin and the original owner. Either fix adminShareDelete (resolve the grant key, audit) or retire the unused /admin/shares pair in favour of the /admin/links family. Decide in review.
  2. UI: the admin Links view becomes "Shares", with links and people in one list, a type filter, and a revoke action. Mockup first.
  3. Tests: admin revokes a grant (204, gone from ListForPath, audit row with the admin as actor); a non-admin gets 403; a link revoke keeps working.

Out of scope: CSV/PDF export and the "mark as reviewed" flow from Share Review. Those could be a later v0.8 follow-up.

Refs: https://support.box.com/hc/en-us/articles/39122091946899 · https://nira.com/google-investigation-tool-actions/ · https://help.dropbox.com/share/set-file-folder-permissions · https://github.com/nextcloud/sharereview · https://github.com/nextcloud/server/issues/5586 · https://help.seafile.com/organization_management/daily_management/

Found during the #831 cleanup on files-bao (2026-10-02). ## What happens today - The admin UI lists **public links only** (`GET /api/v1/admin/links` skips `IsGrant()`). Person-to-person grants never appear anywhere in the admin area. - The older `GET /api/v1/admin/shares` does return grants mixed with links, but no UI uses it, and its rows carry no creator. - `DELETE /api/v1/admin/shares/{token}` returns **404 for a grant id**: it deletes by raw token, while grants are stored under `share.GrantKey(id)`. It also writes **no audit event** (the user-side routes log `share-revoke` / `share-grant-revoke`). - So an admin who needs to cut a grant has to know the path and go through `DELETE /api/v1/grants/{id}`. That is how the #831 test grant was removed. ## What competitors do Instance-wide review **and** revocation of person shares, not just public links, is standard: - **Box:** Admin Console → Content Manager lists a user's content and lets the admin change or remove collaborators and shared links. - **Google Workspace:** the security investigation tool's "Audit file permissions" lists the people and groups with access and lets the admin remove them or change link sharing. - **Dropbox:** Admin console → Content → Manage access → Remove. Admins can also manage members' shared links. - **SharePoint/OneDrive:** admins remove direct access per item, plus data access governance reports. - **Seafile:** the system admin sees and deletes all share links (`/sys/publinkadmin/`) and can unshare libraries from the user detail page. - **Nextcloud:** core has no admin share view. That gap drew years of complaints from admins needing compliance and GDPR reviews (nextcloud/server#5586, closed with a pointer to an app). It is now covered by the official **Share Review** app, which reviews every share type, removes shares, and exports CSV/PDF. ## Proposed scope 1. The server returns grants in the admin list with owner, addressee (kind + name), role, path, created and expiry, and revokes them by id. Every admin revoke writes an audit event naming the acting admin and the original owner. Either fix `adminShareDelete` (resolve the grant key, audit) or retire the unused `/admin/shares` pair in favour of the `/admin/links` family. Decide in review. 2. UI: the admin Links view becomes "Shares", with links and people in one list, a type filter, and a revoke action. **Mockup first.** 3. Tests: admin revokes a grant (204, gone from `ListForPath`, audit row with the admin as actor); a non-admin gets 403; a link revoke keeps working. Out of scope: CSV/PDF export and the "mark as reviewed" flow from Share Review. Those could be a later v0.8 follow-up. Refs: https://support.box.com/hc/en-us/articles/39122091946899 · https://nira.com/google-investigation-tool-actions/ · https://help.dropbox.com/share/set-file-folder-permissions · https://github.com/nextcloud/sharereview · https://github.com/nextcloud/server/issues/5586 · https://help.seafile.com/organization_management/daily_management/
Author
Owner

Scope update (Nikola, 2026-10-02): CSV/PDF export and "mark as reviewed" are in v0.7, not deferred. Tackled together with #722 (public links per area: Personal folders / Spaces). Design and mockup are under review; the spec and plan follow once they are approved.

Scope update (Nikola, 2026-10-02): CSV/PDF export and "mark as reviewed" are **in v0.7**, not deferred. Tackled together with #722 (public links per area: Personal folders / Spaces). Design and mockup are under review; the spec and plan follow once they are approved.
Author
Owner

Decisions (Nikola, 2026-10-02):

  • PDF export is generated server-side in Go with one pure-Go PDF library (candidate: go-pdf/fpdf). The button, the API and any future scheduled job produce the same file. The header carries the instance name, generation time, generating admin, active filters and last review.
  • The owner is notified on admin revoke: a bell item naming the item and who lost access, so the owner knows to ask why. The recipient's view is unchanged: the item leaves "Shared with me", as with an owner revoke.
  • Scheduled export: open. Nikola asked what the benefit is before deciding; answered in chat.
  • Bulk revoke: still open.
Decisions (Nikola, 2026-10-02): - **PDF export is generated server-side in Go** with one pure-Go PDF library (candidate: `go-pdf/fpdf`). The button, the API and any future scheduled job produce the same file. The header carries the instance name, generation time, generating admin, active filters and last review. - **The owner is notified on admin revoke:** a bell item naming the item and who lost access, so the owner knows to ask why. The recipient's view is unchanged: the item leaves "Shared with me", as with an owner revoke. - **Scheduled export:** open. Nikola asked what the benefit is before deciding; answered in chat. - **Bulk revoke:** still open.
Author
Owner

Decisions (Nikola, 2026-10-02), continued:

  • Review reminder: in. A "review every N" interval and a list of reviewers; when a review is due, reviewers get a bell item and an Overview strip appears until someone marks the list as reviewed.
  • Scheduled report: in. PDF, CSV or both on a fixed rhythm. Minimum destination: a folder in a Space (e.g. Compliance / Share reports). Optional extra recipients are named accounts, each getting a copy in Personal › Share reports plus a bell item. No email: Cairn has no SMTP. Precedents: Box saves scheduled reports to a "Box Reports" folder and can subscribe users; Nextcloud Share Review writes to a configured folder and owner; Entra access reviews send reminders and completion notices.
  • All of this sits behind one "Share reviews" switch, off by default, so private and small installs (e.g. a band's file server) never see review bars or schedules. Always available regardless of the switch: the full Shares list, revoke, and manual CSV/PDF export.
  • Bulk revoke: still open.
Decisions (Nikola, 2026-10-02), continued: - **Review reminder:** in. A "review every N" interval and a list of reviewers; when a review is due, reviewers get a bell item and an Overview strip appears until someone marks the list as reviewed. - **Scheduled report:** in. PDF, CSV or both on a fixed rhythm. **Minimum destination: a folder in a Space** (e.g. Compliance / Share reports). Optional extra recipients are named accounts, each getting a copy in Personal › Share reports plus a bell item. No email: Cairn has no SMTP. Precedents: Box saves scheduled reports to a "Box Reports" folder and can subscribe users; Nextcloud Share Review writes to a configured folder and owner; Entra access reviews send reminders and completion notices. - **All of this sits behind one "Share reviews" switch, off by default**, so private and small installs (e.g. a band's file server) never see review bars or schedules. Always available regardless of the switch: the full Shares list, revoke, and manual CSV/PDF export. - **Bulk revoke:** still open.
Author
Owner

Decision (Nikola, 2026-10-02): bulk revoke is in. Checkboxes in the Shares table; the header box selects only what the current filter shows; "Stop sharing selected" opens a confirmation listing every item and owner. Each share is revoked on its own, with one audit row each and one bell per owner covering their items. A failure is reported by name and does not block the others. Available whether Share reviews is on or off.

Decision (Nikola, 2026-10-02): **bulk revoke is in.** Checkboxes in the Shares table; the header box selects only what the current filter shows; "Stop sharing selected" opens a confirmation listing every item and owner. Each share is revoked on its own, with one audit row each and one bell per owner covering their items. A failure is reported by name and does not block the others. Available whether Share reviews is on or off.
Cordy closed this issue 2026-10-02 20:19:25 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#833
No description provided.