mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-25 13:38:19 -05:00
adding tests for sending a share invitation to a user on virtual drive (#8705)
This commit is contained in:
@@ -2328,4 +2328,51 @@ Feature: Send a sharing invitations
|
||||
| permissions-role |
|
||||
| Space Viewer |
|
||||
| Space Editor |
|
||||
| Manager |
|
||||
| Manager |
|
||||
|
||||
@issue-8495
|
||||
Scenario Outline: try to share Shares space with a user
|
||||
When user "Alice" sends the following share invitation for space using the Graph API:
|
||||
| space | Shares |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
Then the HTTP status code should be "400"
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": ["error"],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"code",
|
||||
"innererror",
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"code": {
|
||||
"const": "invalidRequest"
|
||||
},
|
||||
"innererror": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"date",
|
||||
"request-id"
|
||||
]
|
||||
},
|
||||
"message": {
|
||||
"const": "<error-message>"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| permissions-role | error-message |
|
||||
| Space Viewer | space type is not eligible for sharing |
|
||||
| Space Editor | space type is not eligible for sharing |
|
||||
| Manager | space type is not eligible for sharing |
|
||||
| Co Owner | Key: 'DriveItemInvite.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag |
|
||||
@@ -178,7 +178,7 @@ class SharingNgContext implements Context {
|
||||
$resource = $rows['resource'] ?? '';
|
||||
|
||||
// for a disabled and deleted space, resource id is not accessible, so get resource id from the saved response
|
||||
if ($resource === '' && $rows['space'] !== 'Personal') {
|
||||
if ($resource === '' && !\in_array($rows['space'], ['Personal', 'Shares'])) {
|
||||
$itemId = $space['fileId'];
|
||||
} else {
|
||||
$itemId = $this->spacesContext->getResourceId($user, $rows['space'], $resource);
|
||||
|
||||
Reference in New Issue
Block a user