8000 [tests-only][full-ci] add test for list single sharing permission for a drive by nabim777 · Pull Request #11337 · owncloud/ocis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[tests-only][full-ci] add test for list single sharing permission for a drive #11337

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

nabim777
Copy link
Member
@nabim777 nabim777 commented May 21, 2025

Description

This PR has added tests for listing single sharing permission for drive using /drives/{driveID}/root/permissions/{perm-id} api endpoint.

Tests are added for two types of sharing:

  • Invitation-based sharing /v1beta1/drives/{drive-id}/root/permissions/{invitation-perm-id}
  • Link-based sharing /v1beta1/drives/{drive-id}/root/permissions/{link-perm-id}

As I understand it, these are based on the existing endpoint /v1beta1/drives/{drive-id}/root/permissions, which returns a structure like this:

Response
{
  "@libre.graph.permissions.actions.allowedValues": [
    "libre.graph/driveItem/permissions/create",
    ...
    "libre.graph/driveItem/permissions/deny"
  ],
  "@libre.graph.permissions.roles.allowedValues": [
    {
      "@libre.graph.weight": 1,
      "description": "View and download.",
      "displayName": "Can view",
      "id": "a8d5fe5e-96e3-418d-825b-534dbdf22b99"
    },
    ...
  ],
  "value": [
    {
      "grantedToV2": {
        "user": {
          "@libre.graph.userType": "Member",
          "displayName": "Brian Murphy",
          "id": "67e666d8-bb6c-4aea-a65a-14a172c06dac"
        }
      },
      "id": "u:67e666d8-bb6c-4aea-a65a-14a172c06dac",
      "roles": [
        "312c0871-5ef7-4b3a-85b6-0e4074c64049"
      ]
    },
    ...
    {
      "createdDateTime": "2025-05-26T06:49:19.140533456Z",
      "hasPassword": true,
      "id": "nsGxiTzGPSMvfYt",
      "link": {
        "@libre.graph.displayName": "",
        "@libre.graph.quickLink": false,
        "preventsDownload": false,
        "type": "view",
        "webUrl": "https://localhost:9200/s/vvamnhelDAApvAd"
      }
    }
  ]
}

The endpoint(single sharing permission) essentially filters the list to return only the permission that matches the given sharing perm-id.

Example: Get Single Permission by perm-id

Response for invitation-based sharing(according to the swagger):

{
  "grantedToV2": {
    "user": {
      "displayName": "Brian Murphy",
      "id": "67e666d8-bb6c-4aea-a65a-14a172c06dac"
    }
  },
  "id": "u:67e666d8-bb6c-4aea-a65a-14a172c06dac",
  "roles": ["312c0871-5ef7-4b3a-85b6-0e4074c64049"]
}

Response for link-based sharing(Assuming the behaviours like above):

{
      "createdDateTime": "2025-05-26T06:49:19.140533456Z",
      "hasPassword": true,
      "id": "nsGxiTzGPSMvfYt",
      "link": {
        "@libre.graph.displayName": "",
        "@libre.graph.quickLink": false,
        "preventsDownload": false,
        "type": "view",
        "webUrl": "https://localhost:9200/s/vvamnhelDAApvAd"
      }
}

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@nabim777 nabim777 self-assigned this May 21, 2025
@nabim777 nabim777 force-pushed the tests/get-single-permission branch 6 times, most recently from d0452f4 to f01b3a2 Compare May 22, 2025 04:10
@nabim777 nabim777 marked this pull request as ready for review May 22, 2025 04:27
@nabim777 nabim777 force-pushed the tests/get-single-permission branch 4 times, most recently from 35771e8 to 9811825 Compare May 22, 2025 07:01
@nabim777 nabim777 force-pushed the tests/get-single-permission branch 2 times, most recently from dc06b91 to 808f65c Compare May 23, 2025 04:07
@nabim777 nabim777 force-pushed the tests/get-single-permission branch from 808f65c to a2fc304 Compare May 23, 2025 04:10
@nabim777 nabim777 force-pushed the tests/get-single-permission branch 2 times, most recently from 4026a52 to cc1cc8c Compare May 23, 2025 05:44
branch 2 times, most recently from 8eca8db to a6af72c Compare May 26, 2025 03:52
Copy link
Contributor
@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update description

@nabim777
Copy link
Member Author

update description

Description updated. Please let me know if anything is unclear or if you have any suggestions for improvement.

@nabim777 nabim777 requested a review from amrita-shrestha May 26, 2025 08:34
@nabim777 nabim777 force-pushed the tests/get-single-permission branch from a6af72c to 01fc4e0 Compare June 2, 2025 11:26
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
@nabim777 nabim777 force-pushed the tests/get-single-permission branch from 01fc4e0 to 45343c6 Compare June 2, 2025 11:28
@nabim777 nabim777 requested a review from anon-pradip June 2, 2025 11:31
Copy link
sonarqubecloud bot commented Jun 2, 2025

@saw-jan saw-jan merged commit 34a8b9a into master Jun 3, 2025
4 checks passed
@saw-jan saw-jan deleted the tests/get-single-permission branch June 3, 2025 04:14
ownclouders pushed a commit that referenced this pull request Jun 3, 2025
[tests-only][full-ci] add test for list single sharing permission for a drive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0