Skip to content

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

Closed

Description

@JammingBen

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

Activity

  1. 2403905 commented on Feb 14, 2024

    @2403905
    Contributor

    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?

  2. saw-jan commented on Feb 15, 2024

    @saw-jan
    Member

    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`
  3. moved this from Qualification to Backlog in Infinite Scale Team Boardon Mar 7, 2024
  4. rhafer commented on Mar 7, 2024

    @rhafer
    Contributor

    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.

  5. JammingBen commented on Mar 15, 2024

    @JammingBen
    ContributorAuthor

    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?

  6. micbar commented on Mar 15, 2024

    @micbar
    Contributor

    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

  7. self-assigned this
    on Mar 25, 2024
  8. moved this from Backlog to In progress in Infinite Scale Team Boardon Mar 25, 2024
  9. added 4 commits that reference this issue on Mar 26, 2024
    8be2389
    304c923
    154652c
    90b7de2
  10. 7 remaining items

  11. added 10 commits that reference this issue on Apr 3, 2024
    01f0d50
    350abb0
    26400a4
    2a22aa2
    0cf6958
    320f463
    23c6dc2
    2cb8fb5
    0d7e5f2
    bd085bf
  12. added 2 commits that reference this issue on Apr 4, 2024
    57b70a0
    62dc3f4
  13. added a commit that references this issue on Apr 4, 2024
    18d46c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions