fix(sharing-ng): Adapt role conditions to match resource types

This switches our hardcode unfied role conditions to better reflect what
we're actually using them before. The new conditions also allow to differentiate
between roles elgitible for files, folders or drive roots.
Which means that the `/permissions` endpoint is now able to populate the
`roles.allowedValues` field with the correct roles for type of the resource
it is called for.

Fixes: #8331
This commit is contained in:
Ralf Haferkamp
2024-04-12 10:09:13 +02:00
committed by Ralf Haferkamp
parent fe6986ec79
commit 9ca9b78b2b
10 changed files with 217 additions and 174 deletions
@@ -1570,7 +1570,7 @@ Feature: Send a sharing invitations
"message": {
"type": "string",
"enum": [
"cannot set the requested permissions on that type of resource"
"role not applicable to this resource"
]
}
}
@@ -2356,9 +2356,9 @@ Feature: Send a sharing invitations
"""
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 |
| Space Viewer | role not applicable to this resource |
| Space Editor | role not applicable to this resource |
| Manager | role not applicable to this resource |
| Co Owner | Key: 'DriveItemInvite.Roles' Error:Field validation for 'Roles' failed on the 'available_role' tag |