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

[SharingNg] user with role Uploader trying to reshare a resource returns 500 status code #8112

Closed
PrajwolAmatya opened this issue Jan 3, 2024 · 1 comment

Comments

@PrajwolAmatya
Copy link
Contributor

PrajwolAmatya commented Jan 3, 2024

Describe the bug

When a resource is shared with a user with Uploader role, and that user tries to reshare it with other users, it is supposed to fail with proper status code and message as user with role Uploader cannot reshare resource, but it is currently returning status code 500.
Also, user with roles like Viewer tries to reshare resouce to other users with higher roles like Editor, or Manager, it also returns 500 status code.

Steps to reproduce

  1. User Alice creates a folder FolderToShare
  2. Alice shares the folder with user Brian with role Uploader using SharingNg
curl -kv -XPOST "https://localhost:9200/graph/v1beta1/drives/{drive-id}/items/{item-id}/invite" -d '{
  "recipients": [
    {
      "@libre.graph.recipient.type": "user",
      "objectId": "4c510ada-c86b-4815-8820-42cdf82c3d51"
    }
  ],
  "roles": [
    "1c996275-f1c9-4e71-abdf-a42f6495e960"
  ]
}' -uAlice:1234 | jq
  1. Brian tries to reshare folder FolderToShare to user Carol with Viewer role
curl -kv -XPOST "https://localhost:9200/graph/v1beta1/drives/{drive-id}/items/{item-id}/invite" -d '{
  "recipients": [
    {
      "@libre.graph.recipient.type": "user",
      "objectId": "534bb038-6f9d-4093-946f-133be61fa4e7"
    }
  ],
  "roles": [
    "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
  ]
}' -uBrian:1234 | jq

Expected behavior

The share should fail with status code 403 and error message.

Actual behavior

The share fails with status code 500.

@SagarGi
Copy link
Member

SagarGi commented Jan 25, 2024

This issue is fixed and test has been added in this PR #8147. Also Checked it locally.

@SagarGi SagarGi closed this as completed Jan 25, 2024
@micbar micbar added this to the Release 5.0.0 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants