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

[full-ci] Added a new roles viewer/editor with ListGrants #9943

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

2403905
Copy link
Contributor

@2403905 2403905 commented Aug 29, 2024

Description

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment: local
  • add env var to turn on the new roles
GRAPH_AVAILABLE_ROLES="b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6,3284f2d5-0070-4ad8-ac40-c247f7c1fb27,d5041006-ebb3-4b4a-b6a4-7c180ecfb17d,e8ea8b21-abd4-45d2-b893-8d1546378e9e,c1235aea-d106-42db-8458-7d5610fb0a67,3284f2d5-0070-4ad8-ac40-c247f7c1fb27"
  • admin created a folder New folder in the personal and shared it with einstein->viewer and moss->viewer with list grants

1725269370296

  • moss call the sharedWithMe endpoint to get itemID from the value[i].remoteItem.id
Screenshot 2024-08-30 at 15 13 08
  • moss call the item permission endpoint using the itemID and got the result that contains a ListGrants
curl -XGET 'https://localhost:9200/graph/v1beta1/drives/storage-users-1$some-admin-user-id-0000-000000000000/items/storage-users-1$some-admin-user-id-0000-000000000000!f965eb30-5415-428a-97f4-95457af77285/permissions'  -umoss:vista -vk

Response:

{
    "@libre.graph.permissions.actions.allowedValues": [
        "libre.graph/driveItem/permissions/create",
        "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/versions/read",
        "libre.graph/driveItem/deleted/read",
        "libre.graph/driveItem/path/update",
        "libre.graph/driveItem/permissions/delete",
        "libre.graph/driveItem/deleted/delete",
        "libre.graph/driveItem/versions/update",
        "libre.graph/driveItem/deleted/update",
        "libre.graph/driveItem/basic/read",
        "libre.graph/driveItem/permissions/update",
        "libre.graph/driveItem/permissions/deny"
    ],
    "@libre.graph.permissions.roles.allowedValues": [
        {
            "@libre.graph.weight": 1,
            "description": "View only documents, images and PDFs. Watermarks will be applied.",
            "displayName": "Can view (secure)",
            "id": "aa97fe03-7980-45ac-9e50-b325749fd7e6"
        },
        {
            "@libre.graph.weight": 2,
            "description": "View and download.",
            "displayName": "Can view",
            "id": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
        },
        {
            "@libre.graph.weight": 3,
            "description": "View, download and show all invited people",
            "displayName": "Can view",
            "id": "d5041006-ebb3-4b4a-b6a4-7c180ecfb17d"
        },
        {
            "@libre.graph.weight": 4,
            "description": "View, download and upload.",
            "displayName": "Can upload",
            "id": "1c996275-f1c9-4e71-abdf-a42f6495e960"
        },
        {
            "@libre.graph.weight": 5,
            "description": "View, download, upload, edit, add and delete.",
            "displayName": "Can edit",
            "id": "fb6c3e19-e378-47e5-b277-9732f9de6e21"
        },
        {
            "@libre.graph.weight": 6,
            "description": "View, download, upload, edit, add, delete and show all invited people.",
            "displayName": "Can edit",
            "id": "e8ea8b21-abd4-45d2-b893-8d1546378e9e"
        }
    ],
    "value": [
        {
            "createdDateTime": "2024-09-02T11:27:20.408642+02:00",
            "grantedToV2": {
                "user": {
                    "@libre.graph.userType": "Member",
                    "displayName": "Albert Einstein",
                    "id": "4c510ada-c86b-4815-8820-42cdf82c3d51"
                }
            },
            "id": "storage-users-1:some-admin-user-id-0000-000000000000:40814735-e503-49e7-8eb0-dc0e04114a58",
            "invitation": {
                "invitedBy": {
                    "user": {
                        "@libre.graph.userType": "Member",
                        "displayName": "Admin",
                        "id": "some-admin-user-id-0000-000000000000"
                    }
                }
            },
            "roles": [
                "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5"
            ]
        },
        {
            "createdDateTime": "2024-09-02T11:27:37.366853+02:00",
            "grantedToV2": {
                "user": {
                    "@libre.graph.userType": "Member",
                    "displayName": "Maurice Moss",
                    "id": "058bff95-6708-4fe5-91e4-9ea3d377588b"
                }
            },
            "id": "storage-users-1:some-admin-user-id-0000-000000000000:9c8e6d77-f8ff-4297-bcc9-1d9c56d31069",
            "invitation": {
                "invitedBy": {
                    "user": {
                        "@libre.graph.userType": "Member",
                        "displayName": "Admin",
                        "id": "some-admin-user-id-0000-000000000000"
                    }
                }
            },
            "roles": [
                "d5041006-ebb3-4b4a-b6a4-7c180ecfb17d"
            ]
        }
    ]
}

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:

@2403905 2403905 force-pushed the issue-9701 branch 3 times, most recently from bec03cc to 1bf3630 Compare August 30, 2024 12:44
@2403905 2403905 marked this pull request as ready for review August 30, 2024 13:24
@2403905 2403905 requested a review from kulmann as a code owner August 30, 2024 13:24
@2403905
Copy link
Contributor Author

2403905 commented Aug 30, 2024

@tbsbdr Please look at the Share menu screenshot and suggest about the roles naming if the current naming is not like to you.

@micbar
Copy link
Contributor

micbar commented Sep 2, 2024

@tbsbdr @kulmann
I took over because @2403905 is on vacation.

@micbar
Copy link
Contributor

micbar commented Sep 2, 2024

@kulmann Screenshot is updated. Can you approve?

@micbar micbar requested a review from dragonchaser September 2, 2024 09:42
Copy link

sonarqubecloud bot commented Sep 2, 2024

@tbsbdr
Copy link

tbsbdr commented Sep 4, 2024

  1. ... show all invited people is good imo. I also thought about
  2. ... show who else has access --> less precise
  3. ... disclose who has access --> complicated word, so Nr 1 is best I'd say. thanks!

@micbar micbar merged commit 693a311 into owncloud:master Sep 4, 2024
3 checks passed
ownclouders pushed a commit that referenced this pull request Sep 4, 2024
[full-ci] Added a new roles viewer/editor with ListGrants
@micbar micbar mentioned this pull request Sep 12, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[oCIS] Add Transparent Sharing Roles for the Personal Space
3 participants