Repository navigation
Description
In case of an oCIS server, using the Graph API to share with users and groups. The "invite to space" view is the guide to the UI design.
1. Permissions
To check if a user has share permission over an item, check the <oc:permissions> property in the propfind response.
The R permission is the one to check if user is allowed to share.
The "Share" option should be displayed anyway, to give users the access to the permalink. Just hiding the option to add new shares
2. Search user/group
Requests to fetch from server:
Users: GET /graph/v1.0/users?$search="username"&$orderby=displayName
Groups: GET /graph/v1.0/groups?$search="username"&$orderby=displayName
which response is like:
Users:
{
"value": [
{
"accountEnabled": true,
"attributes": [],
"displayName": "John Smith",
"id": "af39b07f-9985-4d1d-a676-ff8b6c153c2a",
"mail": "[email protected]",
"onPremisesSamAccountName": "user1",
"signInActivity": {
"lastSuccessfulSignInDateTime": "2026-05-28T10:51:39Z"
},
"surname": "user1",
"userType": "Member"
},
{
"accountEnabled": true,
"attributes": [],
"displayName": "user2",
"id": "54e131de-1c06-412a-9a85-0f5392c1ebba",
"mail": "[email protected]",
"onPremisesSamAccountName": "user2",
"surname": "user2",
"userType": "Member"
},
{
"accountEnabled": true,
"attributes": [],
"displayName": "user3",
"id": "676a64c8-f715-4a47-8399-d91725682e06",
"mail": "[email protected]",
"onPremisesSamAccountName": "user3",
"surname": "user3",
"userType": "Member"
}
]
}
Groups:
{
"value": [
{
"displayName": "test",
"groupTypes": [],
"id": "c281ae4f-fa90-455f-a01c-e298d1b73e68"
}
]
}
NOTES:
- Mind
search_min_lengthcapability. Request should be sent only when there are at least the given number of characters. - Every typed character, the result list should be updated.
- Every result should be clickable to choose the sharee
- Search must not show your user and other users/groups that are already included in the share
3. Share setup
After choosing the sharee, we have to give it:
- Permission (mandatory)
- Expiration date (not mandatory)
Submitting is only allowed to submit when permission is set
Where to get the available sharing permissions for a given item:
GET https://<url>/graph/v1beta1/drives/<drive-id>/items/<item-id>/permissions
Response like:
"@libre.graph.permissions.roles.allowedValues": [
{
"@libre.graph.weight": 1,
"description": "View and download.",
"displayName": "Can view",
"id": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
},
{
"@libre.graph.weight": 2,
"description": "View, download, upload, edit and add.",
"displayName": "Can edit",
"id": "1c996275-f1c9-4e71-abdf-a42f6495e960"
},
{
"@libre.graph.weight": 3,
"description": "View, download, upload, edit, add and delete.",
"displayName": "Can edit with trashbin",
"id": "fb6c3e19-e378-47e5-b277-9732f9de6e21"
}
]
where libre.graph.permissions.roles.allowedValues contains the information to display and work. The default will be two permissions for files and three for folders
Regular handling for expiration date.
4. Submission
POST https://<url>/graph/v1beta1/drives/<drive-id>/items/<item-id>/invite
with the following body:
{
"recipients": [
{
"@libre.graph.recipient.type": "user/group",
"objectId": "<user/group-id>"
}
],
"roles": [
"<role-id>"
],
"expirationDateTime": "2026-10-04T10:54:51.337Z"
}
response like:
{
"value": [
{
"createdDateTime": "2026-07-22T13:00:18.539379635Z",
"grantedToV2": {
"user": {
"@libre.graph.userType": "Member",
"displayName": "user3",
"id": "ef684aee-f1ad-49b6-a4c2-44a93fb4b9fa"
}
},
"id": "ef881f84-1a45-4745-9e63-e9472336069a:0a91935e-558a-4171-8f96-6dd7cad380ac:1fd53e20-ec0f-498f-bcf1-214dff16472f",
"invitation": {
"invitedBy": {
"user": {
"@libre.graph.userType": "Member",
"displayName": "John Smith",
"id": "0a91935e-558a-4171-8f96-6dd7cad380ac"
}
}
},
"roles": [
"b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
]
}
]
}
TASKS
- Research (if needed)
- Create branch feature/create_file_share
- Development tasks
- Display
+button when user has permission - Display UI to search users/groups
- Display UI to set the permission and expiration date
- Implement logic and network operation
- Implement unit tests (if needed)
- Display
- Code review and apply changes requested
- Design test plan
- QA
- Merge branch feature/create_file_shareinto master
Activity