Skip to content

feat: support the server share-review interface (OCP\Share\ShareReview) - #59

Open
AndyScherzinger wants to merge 4 commits into
mainfrom
feat/ocp-share-review-interface
Open

AndyScherzinger wants to merge 4 commits into
mainfrom
feat/ocp-share-review-interface

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

Adds support for the share-review interface shipped with Nextcloud server 34.0.2 (OCP\Share\ShareReview*), so apps like Deck, Tables, and Forms that implement IShareReviewSource show up in Share Review and can be deleted from it — while keeping full compatibility with Nextcloud < 34.0.2 and the existing app-local extension API.

Changes

Consume the OCP source interface

  • Dispatch both OCP\Share\ShareReview\RegisterShareReviewSourceEvent (guarded by class_exists, NC ≥ 34.0.2 only) and the app-local OCA\ShareReview\Sources\SourceEvent; merged and deduped — on a name collision the OCP-registered source wins
  • Normalize ShareReviewEntry objects and legacy ISource arrays onto one internal row shape; permissions sorted by priority (higher first, per the OCP contract)
  • Sources are resolved via injected ContainerInterface (available since NC 20) instead of \OC::$server

Access-check listener (required for deletion on NC ≥ 34.0.2)

  • New ShareReviewAccessCheckListener answers the ShareReviewAccessCheckEvent that source apps dispatch before deleting: grant when the app is enabled for the current user, deny otherwise. Without it, the default-deny contract makes every app-share deletion fail silently.
  • js/app.js now surfaces failed/denied deletions ("Request could not be processed") instead of always reporting "Share deleted"; bulk delete reports partial success/failure accurately

Opaque permission rendering (wire-format change)

  • permissions changes from the composite ";;" string to a list of {id, displayName, hint, priority} rows with separate password/expiration fields; files and legacy bitmasks are converted server-side (files:* / sharereview:* ids)
  • Table renders per-id icons with hover hints (generic fallback for unknown ids); three new Material Symbols icons for the Forms permissions (listed in REUSE.toml)
  • CSV/PDF exports join the display names; long permission lists wrap in the PDF instead of being truncated

Compatibility

  • min-version stays 20: OCP classes are only touched behind runtime guards; the legacy SourceEvent/ISource API keeps working and is documented as deprecated (removal once min-version ≥ 34)
  • README extension guide rewritten for the OCP API, with a legacy-API deprecation note

Version bumped to 2.4.0.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…s-check event

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…d exports

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger requested a review from Rello August 20, 2026 09:02
@AndyScherzinger AndyScherzinger added the enhancement New feature or request label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant