Skip to content

[FEATURE REQUEST] Sharing NG: Remove link #4973

Closed

Description

@jesmrec

Permission: libre.graph/driveItem/permissions/delete

if available, it shows the trashbin icon in the rows

By clicking the trashbin icon, a dialog will appear asking for confirmation. In case of confirmation, the link will be deleted and the list updated without the removed link

Request:

DELETE https://<url>/graph/v1beta1/drives/<drive-id>/items/<item-id>/permissions/<link-id>

with empty body

TASKS

  • Research (if needed)
  • Create branch feature/remove_public_link_sharing_ng
  • Development tasks
    • Display trashbin icon depending on permissions
    • Show the confirmation dialog
    • Implement logic and network operation
    • Implement unit tests (if needed)
  • Code review and apply changes requested
  • Design test plan
  • QA
  • Merge branch feature/remove_public_link_sharing_ng into master

Activity

  1. added this to the 4.9 - Current milestone on Sep 9, 2026
  2. self-assigned this
    on Nov 6, 2026
  3. joragua commented on Nov 6, 2026

    @joragua
    Member

    Problem

    The Sharing NG flow does not allow users to remove existing public links for files and folders from the Android client. When a user opens the sharing panel, the PUBLIC LINKS section is read-only: existing links are listed but there is no way to delete them. Users must use another client (e.g. the web app) to remove a link they no longer want to keep.


    Desired behavior

    When a user opens the sharing panel for a file or folder and holds the required permission, a trashbin icon is shown on each entry in the PUBLIC LINKS section. Tapping it opens a confirmation dialog. On confirmation, the link is deleted on the server and the PUBLIC LINKS list is updated without the removed link. On cancellation, nothing happens and the dialog is dismissed.


    User stories

    • As a user, I want to tap a trashbin icon on a public link entry to remove it.
    • As a user, I want to be asked for confirmation before a link is deleted, so I don't remove a link by accident.
    • As a user, I want the link to disappear from the PUBLIC LINKS list immediately after deletion, so I can trust what I see.
    • As a user, I only want to see the trashbin icon when I'm actually allowed to delete the link.

    Constraints


    Acceptance criteria

    • The trashbin icon is visible on a public link entry only when the user has libre.graph/driveItem/permissions/delete permission on the item.
    • Tapping the trashbin icon opens a confirmation dialog asking the user to confirm the deletion of the link.
    • On confirmation, a DELETE request is sent to the server for the selected link.
    • On cancellation, the dialog is dismissed and no request is sent.
    • On success, the PUBLIC LINKS list is refreshed so the removed link no longer appears.
    • On network or server error, an error message is shown and the link remains in the list.
    • The deletion affects only the targeted link; other public links and member shares are left untouched.

    Out of scope


    Assumptions

    • The item's drive-id and item-id are available in the sharing panel context.
    • The link-id is available from the existing links list already shown in the sharing panel.
    • The libre.graph/driveItem/permissions/delete permission check can be derived from the same Graph API permissions response already used to populate the sharing panel (the member-share delete icon already uses this exact capability).
    • The create-link / member-share UI already exists and its confirmation-dialog pattern is reusable — the delete confirmation is the same dialog used for member-share removal.
    • The endpoint for link deletion is:
      • DELETE /graph/v1beta1/drives/<drive-id>/items/<item-id>/permissions/<link-id> with an empty body.
    • No request body is needed; a successful DELETE returns no content.

    Implementation notes

    The backend stack for removing a public link already exists end to end — only the UI wiring in the sharing panel is missing.

    Already present (no changes expected, verify only):

    • Use case: RemoveLinkUseCase (owncloudDomain/.../domain/links/usecases/RemoveLinkUseCase.kt), Params(accountName, spaceId, linkId).
    • Repository: LinksRepository.removeLink(accountName, spaceId, linkId) + OCLinksRepository.removeLink(...).
    • Remote datasource: RemoteLinksDataSource.removeLink(...) + OCRemoteLinksDataSource.removeLink(...) → getLinksService(accountName).removeLink(spaceId, linkId).
    • Service: OCLinksService.removeLink → RemoveRemoteLinkOperation.
    • ViewModel: PublicLinksViewModel already exposes removePublicLink(linkId) and removeLinkResultFlow.

    Missing UI wiring (the work for this issue):

    • GraphShareFragment.showLinks() currently calls setPublicLinks(..., canRemoveLinks = false, canEditLinks = false) with the flag hardcoded to false. Pass canRemoveLinks = canRemoveShares (the libre.graph/driveItem/permissions/delete capability already computed in checkPermissions() via DRIVES_DELETE_PERMISSION) so the trashbin icon shows when allowed.
    • GraphShareFragment.onRemovePublicLink(...) is currently an empty stub. Implement it to show a confirmation dialog (mirroring onRemoveShare(...) used for member shares) and, on confirmation, call publicLinksViewModel.removePublicLink(id).
    • Observe publicLinksViewModel.removeLinkResultFlow in subscribeToViewModels() (currently not observed): on success refresh the public links list; on error show an error message.
    • PublicLinksAdapter already has the removePublicLinkButton gated by canRemoveLinks, so no adapter change is expected beyond the flag.

    Verify before implementing:

    • RemoveRemoteLinkOperation currently targets graph/v1beta1/drives/{spaceId}/root/permissions/{linkId}, whereas the member-share delete (RemoveRemoteGraphShareOperation) targets drives/{spaceId}/items/{itemId}/permissions/{shareId}. Confirm the root/permissions path works for non-root items; if not, align it with the items/{itemId}/permissions/{linkId} form described above.

    Reference implementation to follow: the member-share removal flow (RemoveGraphShareAsyncUseCase → GraphShareViewModel.removeGraphShare(shareId) → GraphShareFragment.onRemoveShare(...) confirmation dialog) is the exact parallel for public links.

  4. linked a pull request that will close this issuefeat: remove a public link on an oCIS server #5048on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions