Visitar URL original
[FEATURE REQUEST] Sharing NG: Create new link · Issue #4955 · owncloud/android · GitHub
Skip to content

[FEATURE REQUEST] Sharing NG: Create new link #4955

Open

Description

@jesmrec

In case of an oCIS server, using the Graph API to create a link over any item. Similar to the link creation over an space.

1. Permission:

Same as share with user/groups. No specific permission for links, to show the + option (double check) in the Personal space. In custom folders, need to check if the user has permission over the space to create links. Permission is libre.graph/driveItem/permissions/create and could be used for any space.

2. Create Link

Link is conformed by:

  • Name: optional. If empty Unnamed Link (with translations). Max 255 chars
  • Permission: mandatory. Check screenshot below
  • Password: depends on server parameters and capabilities (password policy)
    • OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD -> mandatory password for Can edit and Secret file drop
    • OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD -> mandatory password for everyone
  • Expiration date: optional

As the spaces, password and expiration date will be displayed once one of the permissions is selected.

Permissions, to be hardcoded like the spaces

Files Folders
Image Image

3. Submission

POST https://<url>:9200/graph/v1beta1/drives/<drive-id>/items/<item-id>/createLink

with body

{
    "password": "UX}H[8Uq/%'Mz-lq4HUin:e{|G46&Rttjt,WT7Y[u6&,",
    "displayName": "A",
    "type": "view",
    "expirationDateTime": "2026-08-26T11:53:08.664Z"
}

type: view, edit, createOnly

"expirationDateTime" only if it was set.

password respecting password policy capabilities.

Response body like:

{
    "createdDateTime": "2026-08-19T11:55:13.45495517Z",
    "hasPassword": true,
    "id": "IAfiUVqqpslHpNK",
    "link": {
        "@libre.graph.displayName": "",
        "@libre.graph.quickLink": false,
        "preventsDownload": false,
        "type": "edit",
        "webUrl": "https://<url>:9200/s/ioRkSIBBVDTKzxy"
    }
}

Link id will be used for editing and deleting the link

4. Link

In every row, the chain icon should open the sharing link, like in space management.

TASKS

  • Research (if needed)
  • Create branch feature/create_public_link_sharing_ng
  • Development tasks
    • Show + based on permissions
    • Show the screen for creating a public link
    • Implement methods and operations for creating a link
    • Implement unit tests (if needed)
  • Code review and apply changes requested
  • Design test plan
  • QA
  • Merge branch feature/create_public_link_sharing_ng into master

Activity

  1. added this to the 4.9 - Current milestone on Aug 19, 2026
  2. jesmrec commented on Oct 14, 2026

    @jesmrec
    MemberAuthor

    Problem

    The Sharing NG flow does not allow users to create new 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 add a new one. Users must use another client (e.g. the web app) to create links.


    Desired behavior

    When a user opens the sharing panel for a file or folder and holds the required permission, a + button is shown in the PUBLIC LINKS section header. Tapping it opens a creation dialog where the user configures the link name, permission type, password and expiration date. On confirmation, the link is created on the server and immediately appears in the PUBLIC LINKS list. The chain icon on the new entry allows sharing the link URL through the Android share sheet.


    User stories

    • As a user, I want to tap a + button in the PUBLIC LINKS section to create a new public link for a file or folder.
    • As a user, I want to give the link an optional name, so I can identify it later.
    • As a user, I want to choose the permission level for the link, so I can control what recipients can do.
    • As a user, I want to set an optional expiration date for the link.
    • As a user, I want the app to enforce a password when the server requires it for the selected permission type.
    • As a user, I want to see the new link appear in the list immediately after creation, and share its URL via the Android share sheet.

    Constraints


    Acceptance criteria

    • The + button is visible in the PUBLIC LINKS section header only when the user has libre.graph/driveItem/permissions/create permission on the item.
    • Tapping + opens a creation view with: name field, permission selector, password field (hidden until permission is selected), and expiration date field (hidden until permission is selected).
    • The permission selector shows Can view and Can edit for files. Can view, Can edit, and Secret file drop for folders.
    • When no name is entered, the link is submitted with the default displayName "Unnamed link" and displayed as "Unnamed link" in the list.
    • Password is required (and the form cannot be submitted without it) when server capabilities mandate it for the selected permission type, following the password policy.
    • Expiration date is optional; when set it is sent as ISO 8601 in the request body.
    • On success, the PUBLIC LINKS list is refreshed from the server to show the newly created link. The POST response is not consumed; the updated list is obtained from the existing links fetch.
    • The chain icon on the new link entry shares its webUrl (obtained from the refreshed links list) through the Android share sheet.
    • On network or server error, an error message is shown and the dialog remains open.

    Out of scope

    • Editing existing public links.
    • Deleting existing public links.
    • Displaying or configuring password-protection status on existing links.
    • Classic WebDAV shares.

    Assumptions

    • The item's drive-id and item-id are available in the sharing panel context.
    • The libre.graph/driveItem/permissions/create permission check can be derived from the same Graph API permissions response already used to populate the sharing panel.
    • The link name defaults to "Unnamed link" (translated) when left empty, and this default value is sent in the request; maximum 255 characters.
    • The space-link creation UI (issue [FEATURE REQUEST] Create a link over a space #4753) already exists and its dialog/bottom sheet pattern is reusable.
    • The endpoint for link creation is: POST /graph/v1beta1/drives//items//createLink
    • Request body fields:
    Field Type Notes
    type String view, edit, or createOnly
    displayName String Defaults to "Unnamed link" when empty
    password String Required when server capabilities mandate it
    expirationDateTime String (ISO 8601) Optional; omit if not set
    • The POST response is not consumed by the client: it is neither parsed nor used to update the UI. After a successful creation the PUBLIC LINKS list is refreshed from the server (existing links fetch), which provides every field needed by the UI (id, displayName, type, webUrl, hasPassword, etc.).
    • Password is mandatory when OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD is set and the selected permission is Can edit or Secret file drop.
    • Password is mandatory for all permission types when OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD is set.
    • The password policy validation (which permissions require a password) must read from the server capabilities already fetched at login/session time — no additional network call needed.
    • Permission type labels (Can edit, Can view, Secret file drop) are hardcoded and translated, matching the pattern from space-link creation. Can edit, Can view for all, Secret file drop only for folders.
    • Permission type labels with subtitle: "Can view" -> "View, Download". "Can edit" -> "View, upload, edit, download, delete". "Secret file drop" -> "Upload only, existing content is not revealed".
    • Password and expiration date fields are revealed only after a permission type is selected, matching the space-link creation pattern.

    Implementation notes

  3. self-assigned this
    on Oct 20, 2026
  4. linked a pull request that will close this issuefeat: create a public link on oCIS servers #5030on Oct 21, 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