mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 20:29:54 -06:00
added test to share space with different roles (#8304)
This commit is contained in:
@@ -1811,7 +1811,7 @@ class GraphHelper {
|
||||
$body
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $baseUrl
|
||||
* @param string $xRequestId
|
||||
|
||||
@@ -1589,3 +1589,78 @@ Feature: Send a sharing invitations
|
||||
| resource-type | path |
|
||||
| file | /textfile1.txt |
|
||||
| folder | FolderToShare |
|
||||
|
||||
|
||||
Scenario Outline: send share invitation for project space 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
|
||||
When user "Alice" sends the following share invitation for space using the Graph API:
|
||||
| space | NewSpace |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
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 |
|
||||
| Space Viewer |
|
||||
| Space Editor |
|
||||
| Co Owner |
|
||||
| Manager |
|
||||
|
||||
@@ -151,9 +151,8 @@ class SharingNgContext implements Context {
|
||||
$rows['resource']
|
||||
);
|
||||
} else {
|
||||
$itemId = ($rows['resourceType'] === 'folder')
|
||||
? $this->spacesContext->getResourceId($user, $rows['space'], $rows['resource'])
|
||||
: $this->spacesContext->getFileId($user, $rows['space'], $rows['resource']);
|
||||
$resource = $rows['resource'] ?? '';
|
||||
$itemId = $this->spacesContext->getResourceId($user, $rows['space'], $resource);
|
||||
}
|
||||
|
||||
if (\array_key_exists('shareeId', $rows)) {
|
||||
@@ -211,6 +210,7 @@ class SharingNgContext implements Context {
|
||||
/**
|
||||
* @When /^user "([^"]*)" sends the following share invitation using the Graph API:$/
|
||||
* @When /^user "([^"]*)" tries to send the following share invitation using the Graph API:$/
|
||||
* @When user :user sends the following share invitation for space using the Graph API:
|
||||
*
|
||||
* @param string $user
|
||||
* @param TableNode $table
|
||||
|
||||
Reference in New Issue
Block a user