Repository navigation
Description
Permalinks (oCIS) should be always reachable. As the app is built, that option is set inside of the Share menu (or Members in case of the space management).
That means, sharing option should be always displayed, and then, inside of it, the permalink. Other options/capabilities will rule whether the "sharing with users" or "sharing by link" will be available.
Current condition in FilterFileMenuOptionsUseCase.kt
if (!onlyAvailableOfflineFiles && shareViaLinkOrWithUsersAllowed && resharingAllowed &&
hasResharePermission) {
!onlyAvailableOfflineFiles-> make it unavailable in the av. offline shortcutshareViaLinkOrWithUsersAllowed-> checks insetup.xmlwhethershare_via_link_featureorshare_with_users_featurearetrueresharingAllowed-> it'strueif the item is not "shared with me" (so, it's an item of my list) or the resharing capability istruehasResharePermission-> it's true if there is only one item selected (no multiselection) and the item itself has the resharing (Rin theoc:permissionsfrom the PROPFIND response)
That condition was built for oC10, but oCIS has a different background. Basically, oCIS does not allow resharing (capability always comes with a false) and those items in custom spaces with no sharing permissions, come from server with empty oc:permissions.
TO DO's:
-
Find the way to make reachable the permalink/private link in all cases:
-
oCIS: Show the
Shareitem regardless theRpermission. That permission is used to show the options in the Share view. TODO: check if there is any other permission available in the Graph API for that aim) -
Add permalink on the rigth side, just in the same layout as the header
-
TASKS
- Research (if needed)
- Create branch feature/permalink_sharing_ng
- Development tasks
- Make "Share" option reachable for a single item
- Implement permalink
- Implement unit tests (if needed)
- Code review and apply changes requested
- Design test plan
- QA
- Merge branch feature/permalink_sharing_ng into master
Activity
joragua commentedon Oct 14, 2026
Problem
On oCIS, the permalink can become unreachable. The only entry point to the permalink is the
Sharescreen, which is opened only whenFileMenuOption.SHAREpasses the gate inFilterFileMenuOptionsUseCase.kt:That condition was designed for oC10. On oCIS it hides the
Shareoption — and with it the permalink — in valid cases:resharingcapability always comes asfalse, soresharingAllowedgatesShareaway even for items the user owns in their own personal space, and the permalink becomes unreachable.resharingcapability always comes asfalse, and items in custom spaces with no sharing permissions arrive from the server with emptyoc:permissions(sohasResharePermission, theRflag, isfalse). TheShareoption is therefore hidden and the permalink is lost.The four conditions, as they stand:
!onlyAvailableOfflineFiles→ keep it unavailable in the available-offline shortcut.shareViaLinkOrWithUsersAllowed→share_via_link_featureorshare_with_users_featureistrueinsetup.xml.resharingAllowed→trueif the item is not "shared with me", or the resharing capability istrue.hasResharePermission→trueonly when a single item is selected and it carries theRpermission inoc:permissions.The permalink UI itself is also not implemented on oCIS. There are two different Share screens:
OcsShareFileFragment+share_file_layout.xml. The permalink is already implemented and working here (getPrivateLinkButton, controlled byshowOrHidePrivateLink(), wired tolistener.copyOrSendPrivateLink(file)). This is out of scope and must not change.GraphShareFragmentinsideShareActivitywith themembers_activity.xmlheader. That header already contains apermanent_link_button(right side, copy-link icon), but it is not functional:ShareActivity.setupFileHeader()hard-codesbinding.permanentLinkButton.isVisible = falseand never sets a click listener. So on oCIS the permalink button is permanently hidden and does nothing.There is a working reference pattern for the exact same button in
SpaceMembersActivity.kt, which doespermanentLinkButton.setOnClickListener { copyOrSendLink(...) }.ShareActivityalready implements thecopyOrSendPrivateLink(file)override (fileOperationsHelper.copyOrSendPrivateLink(file)), so the plumbing to copy/send the link already exists.Desired behavior
Sharemenu option is always reachable for a single selected item (both personal and custom spaces), regardless of theresharing/sharingcapability values, theRpermission, or theshare_via_link_feature/share_with_users_featuresetup flags. The individual sections inside the Share screen ("share with users" / "share by link") continue to be ruled by their own capabilities and feature flags; only the reachability of the screen (and therefore the permalink) becomes unconditional on oCIS.permanent_link_buttoninmembers_activity.xmlmust be made visible when a private link exists and wired to copy/send that link, mirroring theSpaceMembersActivityreference. It must be hidden when the item has no private link or thefilesPrivateLinkscapability isFALSE.Sharegating condition and the already-working private-link button inOcsShareFileFragmentstay exactly as they are today.User stories
Sharefor an item in my personal space, so I can still copy its permalink even though theresharingcapability isfalse.Sharefor an item in a custom space with no sharing permissions, so I can still copy its permalink.Shareor the private link to change.Constraints
spacescapability is enabled, i.e.isSpacesAllowed()). The oC10 code path MUST be left byte-for-byte equivalent in behavior.Shareoption MUST remain hidden in the available-offline shortcut (onlyAvailableOfflineFiles).Shareoption MUST remain restricted to single selection (no multiselection).permanent_link_buttoninmembers_activity.xmland the existingcopyOrSendPrivateLink(file)plumbing; no new layout position and no new copy/send mechanism.Acceptance criteria
Shareis shown even when theresharingcapability isfalse.Shareis shown even whenoc:permissionsis empty (noR) and theresharingcapability isfalse.Shareis shown even when bothshare_via_link_featureandshare_with_users_featurearefalse.Shareis NOT shown in the available-offline shortcut (onlyAvailableOfflineFiles).Shareis NOT shown for multiselection.permanent_link_buttonin the Share header is visible and copies/sends the permalink when the item has a private link andfilesPrivateLinksis notFALSE.permanent_link_buttonstays hidden when the item has no private link orfilesPrivateLinksisFALSE.Sharemenu option appears under exactly the same conditions as before this change (no observable difference).OcsShareFileFragmentkeeps working exactly as today.Out of scope
Sharegate and the oC10 private-link button (OcsShareFileFragment/share_file_layout.xml) are untouched.Assumptions
spacescapability being enabled (OCCapability.isSpacesAllowed()), the same discriminator already used across the app (MainApp,SpacesListViewModel,AuthenticationViewModel, …). The stored capability is already available insideFilterFileMenuOptionsUseCaseviacapabilityRepository.OcsShareFileFragment(headergetPrivateLinkButton, controlled byshowOrHidePrivateLink()), so no oC10 work is required.permanent_link_buttonexists inmembers_activity.xmlbutShareActivity.setupFileHeader()forces it hidden and sets no listener. It must be implemented following oC10's show/hide rule (hidden whenfile.privateLinkis null/empty orfilesPrivateLinksisFALSE) and theSpaceMembersActivityclick wiring, reusingcopyOrSendPrivateLink(file).OCFile.privateLinkis populated for oCIS from theoc:privatelinkPROPFIND property (RemoteFilemapsOCPrivatelink), so no data-layer change is needed.oc:permissionsPROPFIND property as oC10; there is no separate file-level Graph "sharePermission". TheRflag therefore cannot be relied upon for oCIS items, which is why oCIS reachability must not depend on it.Sharegating branch inFilterFileMenuOptionsUseCase.kt; the permalink change is confined toShareActivity.setupFileHeader(). NoParams, caller, or Koin changes are required, because the oC10 branch keeps using all existing inputs.Implementation notes
FilterFileMenuOptionsUseCase.kt:90-91— split theSHAREgate by server type using the already-fetchedcapability:Do not remove
resharingAllowed,hasResharePermission,anyFileSharedWithMe, thecapabilitylookup, thecapabilityRepositorydependency, or theshareViaLinkAllowed/shareWithUsersAllowedParamsfields — they are all still needed by the oC10 branch. No caller (MainFileListViewModel,FileDetailsViewModel,PreviewVideoViewModel,PreviewAudioViewModel,PreviewTextViewModel,PreviewImageViewModel) and no Koin factory (UseCaseModule) changes are required.ShareActivity.setupFileHeader()— implement the oCIS permalink: makepermanentLinkButtonvisible whenfile.privateLinkis non-empty andfilesPrivateLinksis notFALSE(mirror oC10'sshowOrHidePrivateLink()), and setpermanentLinkButton.setOnClickListener { copyOrSendPrivateLink(file) }(reference:SpaceMembersActivity.kt:74). Replace the hard-codedbinding.permanentLinkButton.isVisible = falseatShareActivity.kt:172.Add a changelog entry under
changelog/unreleased/.[-][FEATURE REQUEST] Permalink reachability (oC10/oCIS)[/-][+][FEATURE REQUEST] Sharing NG: Permalink[/+]