Skip to content

enhancement: make use of unified role for the graph invitation endpoint - #7751

Merged
fschade merged 1 commit into
owncloud:masterfrom
fschade:graph-invite-unifiedrole
Nov 23, 2023
Merged

fschade merged 1 commit into
owncloud:masterfrom
fschade:graph-invite-unifiedrole

Conversation

@fschade

@fschade fschade commented Nov 18, 2023 •

Copy link
Copy Markdown
Contributor

Description

Up to now the graph beta invitation endpoint made use of the cs3 permission objects (named set aka role).
With the implementation of the new unified roles the api is now able to use those as described in the swagger spec.

Related Issue

Motivation and Context

make use of the unified roles as described in the openAPI spec.

How Has This Been Tested?

  • manual testing
  • unit tests

example:

request

POST {{host}}/graph/v1beta1/drives/{{drive-id}}/items/{{item-id}}/invite
Authorization: Basic {{user_admin_login}} {{user_admin_password}}
Content-Type: application/json

body (roles)

{
  "recipients":[
    {"objectId": "{{user_marie_id}}"}
  ],
  "ExpirationDateTime": "2055-07-15T14:00:00.000Z",
  "roles": [
    "{{role_viewer_id}}",
  ]
}

response (roles)

{
  "value": [
    {
      "expirationDateTime": "2055-07-15T16:00:00+02:00",
      "grantedToV2": {
        "user": {
          "displayName": "Marie Skłodowska Curie",
          "id": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"
        }
      },
      "id": "3496f80c-b4c7-40cd-9ee9-f7bfb77c671c:4353a0e1-a947-4588-8be2-7730ac879eda:592a5934-9dda-41f9-8925-ae96411dbdb8",
      "roles": [
        "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
      ]
    }
  ]
}

body (@libre.graph.permissions.actions)

{
  "recipients":[
    {"objectId": "{{user_marie_id}}"}
  ],
  "ExpirationDateTime": "2055-07-15T14:00:00.000Z",
  "@libre.graph.permissions.actions":[
    "libre.graph/driveItem/content/read"
  ]
}

response (@libre.graph.permissions.actions)

{
  "value": [
    {
      "@libre.graph.permissions.actions": [
        "libre.graph/driveItem/content/read"
      ],
      "expirationDateTime": "2055-07-15T16:00:00+02:00",
      "grantedToV2": {
        "user": {
          "displayName": "Marie Skłodowska Curie",
          "id": "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"
        }
      },
      "id": "3496f80c-b4c7-40cd-9ee9-f7bfb77c671c:4353a0e1-a947-4588-8be2-7730ac879eda:53cff278-5c94-47b1-99ca-5ce89095b385"
    }
  ]
}

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:

@fschade fschade self-assigned this Nov 19, 2023
@fschade fschade added the Status:Needs-Review Needs review from a maintainer label Nov 19, 2023
…nt, applying multiple roles works and result in a merged cs3 permission set
@fschade
fschade requested a review from rhafer November 23, 2023 11:18
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

98.7% 98.7% Coverage
0.0% 0.0% Duplication

@fschade
fschade merged commit 40d356c into owncloud:master Nov 23, 2023
ownclouders pushed a commit that referenced this pull request Nov 23, 2023
…nt, applying multiple roles works and result in a merged cs3 permission set (#7751)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:Needs-Review Needs review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants