diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index 11a237767cb..a6bac3a4176 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -2039,3 +2039,178 @@ Feature: Send a sharing invitations } } """ + + + Scenario Outline: send share invitation for project space resource to user with different roles + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "NewSpace" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "NewSpace" with content "share space items" to "textfile1.txt" + And user "Alice" has created a folder "FolderToShare" in space "NewSpace" + When user "Alice" sends the following share invitation for space using the Graph API: + | resource | | + | space | NewSpace | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | | + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "required": [ + "grantedToV2", + "roles" + ], + "properties": { + "grantedToV2": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "object", + "required": [ + "displayName", + "id" + ], + "properties": { + "displayName": { + "type": "string", + "enum": [ + "Brian Murphy" + ] + }, + "id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + } + } + } + } + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "pattern": "^%role_id_pattern%$" + } + } + } + } + } + } + } + """ + Examples: + | permissions-role | path | + | Viewer | textfile1.txt | + | File Editor | textfile1.txt | + | Viewer | FolderToShare | + | Editor | FolderToShare | + | Uploader | FolderToShare | + + + Scenario Outline: send share invitation for project space resource to group with different roles + Given using spaces DAV path + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And the following users have been added to the following groups + | username | groupname | + | Brian | grp1 | + | Carol | grp1 | + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "NewSpace" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "NewSpace" with content "share space items" to "textfile1.txt" + And user "Alice" has created a folder "FolderToShare" in space "NewSpace" + When user "Alice" sends the following share invitation for space using the Graph API: + | resource | | + | space | NewSpace | + | sharee | grp1 | + | shareType | group | + | permissionsRole | | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | | + And for user "Carol" the space Shares should contain these entries: + | | + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "roles", + "grantedToV2" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%permissions_id_pattern%$" + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "pattern": "^%role_id_pattern%$" + } + }, + "grantedToV2": { + "type": "object", + "required": [ + "group" + ], + "properties": { + "group": { + "type": "object", + "required": [ + "id", + "displayName" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^%group_id_pattern%$" + }, + "displayName": { + "type": "string", + "enum": [ + "grp1" + ] + } + } + } + } + } + } + } + } + } + } + """ + Examples: + | permissions-role | path | + | Viewer | textfile1.txt | + | File Editor | textfile1.txt | + | Viewer | FolderToShare | + | Editor | FolderToShare | + | Uploader | FolderToShare |