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

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

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Nov 18, 2023

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
@fschade fschade force-pushed the graph-invite-unifiedrole branch 2 times, most recently from 8e2f83e to d3537b3 Compare November 22, 2023 16:24
services/graph/pkg/validate/libregraph.go Outdated Show resolved Hide resolved
@fschade fschade force-pushed the graph-invite-unifiedrole branch from d3537b3 to 92fc803 Compare November 23, 2023 08:31
services/graph/pkg/service/v0/driveitems.go Show resolved Hide resolved
services/graph/pkg/validate/libregraph.go Outdated Show resolved Hide resolved
…nt, applying multiple roles works and result in a merged cs3 permission set
@fschade fschade force-pushed the graph-invite-unifiedrole branch from 92fc803 to 5888508 Compare November 23, 2023 11:17
@fschade fschade requested a review from rhafer November 23, 2023 11:18
Copy link

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
2 checks passed
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