Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sharing NG] getting permissions for drive via driveId doesn't work #8351

Closed
JammingBen opened this issue Feb 2, 2024 · 5 comments
Closed
Assignees
Labels

Comments

@JammingBen
Copy link
Contributor

JammingBen commented Feb 2, 2024

Describe the bug

Permissions of a drive currently can't be fetched when using the driveId as itemId.

Steps to reproduce

  1. Create a drive
  2. Try fetching permissions for that drive via the drive's id: curl "https://localhost:9200/graph/v1beta1/drives/{drive-id}/items/{drive-id}/permissions" -u admin:admin -vk | jq

Expected behavior

The permissions for that drive should be returned by the server.

Actual behavior

The server complains about an invalid itemId. This probably happens because the driveId only consists of 2 parts and is missing the nodeId as third part. Appending the last part of the driveId as nodeId works. But consumer of the API shouldn't need to care about id formats.

cc @rhafer

@2403905
Copy link
Contributor

2403905 commented Feb 14, 2024

Tested for the personal space. It works properly /graph/v1beta1/drives/storage-users-1$some-admin-user-id-0000-000000000000/items/storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000/permissions
What format did you use?

@saw-jan
Copy link
Member

saw-jan commented Feb 15, 2024

Tested for the personal space. It works properly /graph/v1beta1/drives/storage-users-1$some-admin-user-id-0000-000000000000/items/storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000/permissions What format did you use?

Yeah, this works. But the issue is about using:

-/graph/v1beta1/drives/storage-users-1$some-admin-user-id-0000-000000000000/items/storage-users-1$some-admin-user-id-0000-000000000000!some-admin-user-id-0000-000000000000/permissions`
+/graph/v1beta1/drives/storage-users-1$some-admin-user-id-0000-000000000000/items/storage-users-1$some-admin-user-id-0000-000000000000/permissions`

@rhafer rhafer moved this from Qualification to Backlog in Infinite Scale Team Board Mar 7, 2024
@rhafer
Copy link
Contributor

rhafer commented Mar 7, 2024

Permissions of a drive currently can't be fetched when using the driveId as itemId.

Yes a driveId is not itemId. So this is kind of expected I guess. Having that endpoint accept driveId as itemId shouldn't be to hard, however I think we would be better of implementing:

GET /graph/v1beta1/drives/{driveId}/root which basically returns the drives root item, and /graph/v1beta1/drives/{driveId}/root/permissions which would return the permissions.

@JammingBen
Copy link
Contributor Author

GET /graph/v1beta1/drives/{driveId}/root which basically returns the drives root item, and /graph/v1beta1/drives/{driveId}/root/permissions which would return the permissions.

So Web would need to make an extra call to /graph/v1beta1/drives/{driveId}/root just to retrieve the correct itemId?

@micbar
Copy link
Contributor

micbar commented Mar 15, 2024

Ralf is trying to make the item id obsolete for space roots.

The /root url part is basically an alias for the item id of the space root

@rhafer rhafer self-assigned this Mar 25, 2024
@rhafer rhafer moved this from Backlog to In progress in Infinite Scale Team Board Mar 25, 2024
@JammingBen JammingBen mentioned this issue Mar 25, 2024
40 tasks
rhafer added a commit to rhafer/ocis that referenced this issue Mar 26, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 26, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Mar 27, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: owncloud#8351
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: owncloud#8351
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 3, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: owncloud#8351
rhafer added a commit to rhafer/libre-graph-api that referenced this issue Apr 3, 2024
This adds a couple of new enpdoints for being able to access a drive's
root more easily.

Related: owncloud/ocis#8351
rhafer added a commit to rhafer/libre-graph-api that referenced this issue Apr 3, 2024
This adds a couple of new enpdoints for being able to access a drive's
root more easily.

Related: owncloud/ocis#8351
rhafer added a commit to rhafer/ocis that referenced this issue Apr 4, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 4, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Apr 4, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: owncloud#8351
rhafer added a commit to rhafer/ocis that referenced this issue Apr 4, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: owncloud#8351
@rhafer rhafer closed this as completed in 18d46c1 Apr 4, 2024
rhafer added a commit that referenced this issue Apr 4, 2024
rhafer added a commit that referenced this issue Apr 4, 2024
This add support for the following graph routes:

POST /drives/{driveID}/root/createLink
DELETE /drives/{driveID}/root/permissions/{permissionID}
PATCH /drives/{driveID}/root/permissions/{permissionID}
and
POST /drives/{driveID}/root/permissions/{permissionID}/setPassword

This should significantly improve handling of permissions on spaces
as there is no need to figure to the drive's root itemid anymore.

Partial Fix: #8351
@github-project-automation github-project-automation bot moved this from In progress to Done in Infinite Scale Team Board Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

5 participants