cryptomator / cryptomator/ios

Access shared folders in OneDrive for Business

Open
#290 2 comments 1 reaction 0 assignees View on GitHub
storage:onedrive
Dominant language
Swift
Stars
288
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Original issue from the old app: https://github.com/cryptomator/cryptomator-ios/issues/139

## Status Quo

OneDrive (personal account): You can access shared folders. If you're unable to access a shared folder that was shared with you (i.e., you are not the owner), you have to [add the shared folder to your OneDrive](https://support.microsoft.com/en-us/office/add-and-sync-shared-folders-to-onedrive-for-home-8a63cd47-1526-4cd8-bd09-ee3f9bfc1504#bkmk_add).

OneDrive for Business (work/school account): You can only access shared folders that you own. Even if you [add a shortcut to "My Files"](https://support.microsoft.com/en-us/office/add-shortcuts-to-shared-folders-in-onedrive-for-work-or-school-d66b1347-99b7-4470-9360-ffc048d35a33), you cannot access the shared folder.

## Technical Details

To make this point clear: Shortcuts are not part of the [directory listing](https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http). It seems that there is no way to implement this feature transparently. So there is no way to "merge" shared files with your own files. That's actually what the shortcuts are for (in my opinion) but they're missing.

There is an API to list all shared items (not being the owner) via [`GET /me/drive/sharedWithMe`](https://learn.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0&tabs=http). With these identifiers, you can access the shared folders.

## Proposed Solution

Since personal accounts are not affected by this issue, the `driveType` should be retrieved and persisted after a successful authentication. You can get it via [`GET /me/drive`](https://learn.microsoft.com/en-us/graph/api/drive-get?view=graph-rest-1.0&tabs=http).

When adding a vault in OneDrive: If the `driveType` is `business` (and maybe `documentLibrary`?!), we need to present a choice between the user's own files and shared items. An optimization could be to detect if there are any shared items at all so that the choice can be skipped. In case of shared items, we need a new screen that lists all available shared folders (shared files don't make any sense here). If one of the folder is selected, the "new" root identifier is the one from the selection (incl. drive identifier).

Caveat: If we set the selected folder as root, there will be the problem that the root folder doesn't have a name (classic example if the vault is the root folder itself). When implementing this feature, we should experiment with setting the parent reference as root but still showing the shared folder directly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.