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

[OCM] roles id not available on sharedWithMe response when listing shares shared with editor role #11054

Open
PrajwolAmatya opened this issue Feb 25, 2025 · 8 comments · Fixed by #11071
Assignees
Labels

Comments

@PrajwolAmatya
Copy link
Contributor

PrajwolAmatya commented Feb 25, 2025

Describe the bug

When a resource is shared with editor role and sharee (federated user) lists the shares with sharedWithMe endpoint, then the roles id is not available in the response. The roles id is only availble for viewer role.

Steps to reproduce

  1. Create two ocis instance
  2. On first instance as user Alice create two folders folder1 and folder2
  3. Share folder1 with Viewer role and folder2 with Editor role to federated user Brian
  4. Brian lists the shares
curl -kv -XGET "https://localhost:10200/graph/v1beta1/me/drive/sharedWithMe" -ubrian:1234 | jq

Response

{
  "value": [
    {
      "@UI.Hidden": false,
      "@client.synchronize": false,
      "createdBy": {
        "user": {
          "@libre.graph.userType": "Federated",
          "displayName": "Alice Hansen",
          "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
        }
      },
      "eTag": "\"76612f8dba841556b79b6bbdb35b61c8\"",
      "folder": {},
      "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$89f37a33-858b-45fa-8890-a1f2b27d90e1!1970e4d0-1e09-4771-abbb-46d37d80e3e8",
      "lastModifiedDateTime": "2025-02-25T09:37:32+05:45",
      "name": "folder2",
      "parentReference": {
        "driveId": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
        "driveType": "virtual",
        "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668"
      },
      "remoteItem": {
        "createdBy": {
          "user": {
            "@libre.graph.userType": "Federated",
            "displayName": "Alice Hansen",
            "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
          }
        },
        "eTag": "\"76612f8dba841556b79b6bbdb35b61c8\"",
        "folder": {},
        "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$dd9e1af6-ed6f-4bf2-afc9-defb22ca805e!Lw==",
        "lastModifiedDateTime": "2025-02-25T09:37:32+05:45",
        "name": "folder2",
        "permissions": [
          {
            "@libre.graph.permissions.actions": [
              "libre.graph/driveItem/children/create",
              "libre.graph/driveItem/standard/delete",
              "libre.graph/driveItem/path/read",
              "libre.graph/driveItem/quota/read",
              "libre.graph/driveItem/content/read",
              "libre.graph/driveItem/upload/create",
              "libre.graph/driveItem/permissions/read",
              "libre.graph/driveItem/children/read",
              "libre.graph/driveItem/deleted/read",
              "libre.graph/driveItem/path/update",
              "libre.graph/driveItem/deleted/update",
              "libre.graph/driveItem/basic/read"
            ],
            "createdDateTime": "2025-02-25T09:37:57.34485494+05:45",
            "grantedToV2": {
              "user": {
                "@libre.graph.userType": "Member",
                "displayName": "Brian Murphy",
                "id": "de38f0cf-5539-4796-bb06-ccd2c1129b75"
              }
            },
            "id": "dd9e1af6-ed6f-4bf2-afc9-defb22ca805e",
            "invitation": {
              "invitedBy": {
                "user": {
                  "@libre.graph.userType": "Federated",
                  "displayName": "Alice Hansen",
                  "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
                }
              }
            }
          }
        ]
      }
    },
    {
      "@UI.Hidden": false,
      "@client.synchronize": false,
      "createdBy": {
        "user": {
          "@libre.graph.userType": "Federated",
          "displayName": "Alice Hansen",
          "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
        }
      },
      "eTag": "\"82790e0254a458e18a3820ca4b19b049\"",
      "folder": {},
      "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$89f37a33-858b-45fa-8890-a1f2b27d90e1!4256b695-044e-4d24-93de-b29d9d47f26e",
      "lastModifiedDateTime": "2025-02-25T09:37:26+05:45",
      "name": "folder1",
      "parentReference": {
        "driveId": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
        "driveType": "virtual",
        "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668"
      },
      "remoteItem": {
        "createdBy": {
          "user": {
            "@libre.graph.userType": "Federated",
            "displayName": "Alice Hansen",
            "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
          }
        },
        "eTag": "\"82790e0254a458e18a3820ca4b19b049\"",
        "folder": {},
        "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$e38b5840-5875-4b68-972e-1ee9c01780d7!Lw==",
        "lastModifiedDateTime": "2025-02-25T09:37:26+05:45",
        "name": "folder1",
        "permissions": [
          {
            "createdDateTime": "2025-02-25T09:37:48.376173839+05:45",
            "grantedToV2": {
              "user": {
                "@libre.graph.userType": "Member",
                "displayName": "Brian Murphy",
                "id": "de38f0cf-5539-4796-bb06-ccd2c1129b75"
              }
            },
            "id": "e38b5840-5875-4b68-972e-1ee9c01780d7",
            "invitation": {
              "invitedBy": {
                "user": {
                  "@libre.graph.userType": "Federated",
                  "displayName": "Alice Hansen",
                  "id": "Njk4MzRhYjctY2U5MC00NGZhLWE4ZjEtNzgxNjY3YWIzYjk2QGh0dHBzOi8vbG9jYWxob3N0OjkyMDA="
                }
              }
            },
            "roles": [
              "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
            ]
          }
        ]
      }
    }
  ]
}

Here, it can be seen that while listing share, roles property is not available for folder2 which was shared with Editor role.
This same behavior exists for file sharing.

Expected behavior

The roles property should be available in the sharedWithMe response for resources shared with all permissions role.

Actual behavior

The roles property is not available for resources shared with Editor role.

Setup

  • Infinite Scale 7.1.0-rc.4+4a2f10519b Community
  • ownCloud Web UI 11.1.3
@PrajwolAmatya
Copy link
Contributor Author

CC @kobergj @2403905

@2403905
Copy link
Contributor

2403905 commented Feb 26, 2025

Fixed cs3org/reva#5100

{
    "value": [
        {
            "@UI.Hidden": false,
            "@client.synchronize": false,
            "createdBy": {
                "user": {
                    "@libre.graph.userType": "Federated",
                    "displayName": "Maurice Moss",
                    "id": "MDU4YmZmOTUtNjcwOC00ZmU1LTkxZTQtOWVhM2QzNzc1ODhiQGh0dHBzOi8vbG9jYWxob3N0OjEwMjAw"
                }
            },
            "eTag": "\"55d28e569eaa71db079050d76346843e\"",
            "folder": {},
            "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$89f37a33-858b-45fa-8890-a1f2b27d90e1!01c72a71-c59e-4958-9494-22bdb449b4b7",
            "lastModifiedDateTime": "2025-02-26T17:20:19+01:00",
            "name": "edit",
            "parentReference": {
                "driveId": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
                "driveType": "virtual",
                "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668"
            },
            "remoteItem": {
                "createdBy": {
                    "user": {
                        "@libre.graph.userType": "Federated",
                        "displayName": "Maurice Moss",
                        "id": "MDU4YmZmOTUtNjcwOC00ZmU1LTkxZTQtOWVhM2QzNzc1ODhiQGh0dHBzOi8vbG9jYWxob3N0OjEwMjAw"
                    }
                },
                "eTag": "\"55d28e569eaa71db079050d76346843e\"",
                "folder": {},
                "id": "89f37a33-858b-45fa-8890-a1f2b27d90e1$712dc32b-d875-406c-851a-b407084161c4!Lw==",
                "lastModifiedDateTime": "2025-02-26T17:20:19+01:00",
                "name": "edit",
                "permissions": [
                    {
                        "createdDateTime": "2025-02-26T17:18:28.15348+01:00",
                        "grantedToV2": {
                            "user": {
                                "@libre.graph.userType": "Member",
                                "displayName": "Admin",
                                "id": "3443cf35-ecd0-4c75-bb79-31f70a690c5c"
                            }
                        },
                        "id": "712dc32b-d875-406c-851a-b407084161c4",
                        "invitation": {
                            "invitedBy": {
                                "user": {
                                    "@libre.graph.userType": "Federated",
                                    "displayName": "Maurice Moss",
                                    "id": "MDU4YmZmOTUtNjcwOC00ZmU1LTkxZTQtOWVhM2QzNzc1ODhiQGh0dHBzOi8vbG9jYWxob3N0OjEwMjAw"
                                }
                            }
                        },
                        "roles": [
                            "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
                        ]
                    }
                ]
            }
        }
    ]
}

@2403905
Copy link
Contributor

2403905 commented Feb 26, 2025

@PrajwolAmatya
Please take a look at the failed tests #11071

@PrajwolAmatya
Copy link
Contributor Author

@2403905 I have updated the test. The CI should be green. 👍

@2403905
Copy link
Contributor

2403905 commented Feb 27, 2025

Thank you

@PrajwolAmatya
Copy link
Contributor Author

Its working fine for Editor role but for listing file shares with File Editor role, it is listing the permission and not listing the roles property.

cc @2403905

@PrajwolAmatya PrajwolAmatya reopened this Mar 3, 2025
@2403905
Copy link
Contributor

2403905 commented Mar 3, 2025

We are restricted by the OCM protocol and it is a kind of problem recognizing the Editor and File Editor because we sent only allowed "read" or "write" parameter. https://cs3org.github.io/OCM-API/docs.html?branch=develop&repo=OCM-API&user=cs3org#/paths/~1shares/post
permissions | Array of stringsItems Enum: "read" "write" "share"

Image

@PrajwolAmatya
Copy link
Contributor Author

The roles property is available for the Viewer role but not for the File Editor. It looks like the limitation for the File Editor role.

Should we close this issue?
cc @2403905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants