Skip to content

Commit

Permalink
adding test for listing permissions with space editor without version…
Browse files Browse the repository at this point in the history
… role enabled
  • Loading branch information
nirajacharya2 committed Oct 29, 2024
1 parent 318edb0 commit c935764
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 20 deletions.
95 changes: 95 additions & 0 deletions tests/acceptance/features/apiSharingNg1/listPermissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2296,4 +2296,99 @@ Feature: List a sharing permissions
}
}
}
"""


Scenario: user lists permissions of a folder in personal space after enabling 'Space Editor Without Versions' role
Given the administrator has enabled the permissions role "Space Editor Without Versions"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
When user "Alice" lists the permissions of space "new-space" using root endpoint of the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"@libre.graph.permissions.actions.allowedValues",
"@libre.graph.permissions.roles.allowedValues"
],
"properties": {
"@libre.graph.permissions.roles.allowedValues": {
"type": "array",
"minItems": 4,
"maxItems": 4,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"@libre.graph.weight",
"description",
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Can view"
}
}
},
{
"type": "object",
"required": [
"@libre.graph.weight",
"description",
"displayName",
"id"
],
"properties": {
"@libre.graph.weight": {
"const": "2"
},
"description": {
"const": "View, download, upload, edit, add and delete."
},
"displayName": {
"const": "Can edit without versions"
},
"id": {
"const": "3284f2d5-0070-4ad8-ac40-c247f7c1fb27"
}
}
},
{
"type": "object",
"required": [
"@libre.graph.weight",
"description",
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Can edit"
}
}
},
{
"type": "object",
"required": [
"@libre.graph.weight",
"description",
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Can manage"
}
}
}
]
}
}
}
}
"""
21 changes: 1 addition & 20 deletions tests/acceptance/features/apiSpaces/changeSpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -600,23 +600,4 @@ Feature: Change data of space
Examples:
| role |
| Space Editor Without Versions |
| Space Editor |
@env-config
Scenario: space member with role 'Space Editor Without Versions' edits the space
Given the administrator has enabled the permissions role "Space Editor Without Versions"
And these users have been created with default attributes and without skeleton files:
| username |
| Carol |
And user "Alice" has sent the following space share invitation:
| space | Project Jupiter |
| sharee | Carol |
| shareType | user |
| permissionsRole | Space Editor Without Versions |
When user "Carol" creates a folder ".space" in space "Project Jupiter" using the WebDav Api
Then the HTTP status code should be "201"
When user "Carol" uploads a file inside space "Project Jupiter" with content "hello" to ".space/readme.md" using the WebDAV API
Then the HTTP status code should be "201"
When user "Carol" sets the file ".space/readme.md" as a description in a special section of the "Project Jupiter" space
Then the HTTP status code should be "200"
When user "Carol" removes the folder ".space" from space "Project Jupiter"
Then the HTTP status code should be "204"
| Space Editor |

0 comments on commit c935764

Please sign in to comment.