Skip to content

Commit

Permalink
Merge pull request #10770 from owncloud/update-share-permission-role
Browse files Browse the repository at this point in the history
[tests-only][full-ci] added test to update share permissions role of a resource to a permissons role which is not enabled
  • Loading branch information
PrajwolAmatya authored Dec 17, 2024
2 parents 5d86cd2 + 8c47aa1 commit 4404df6
Showing 1 changed file with 246 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1181,3 +1181,249 @@ Feature: Update permission of a share
| Space Editor | Manager |
| Manager | Space Viewer |
| Manager | Space Editor |

@issue-10768
Scenario Outline: sharer updates share permissions role of a resource to Secure Viewer without enabling it
Given user "Alice" has created folder "folderToShare"
And user "Alice" has uploaded file with content "hello world" to "textfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Alice" updates the last resource share with the following properties using the Graph API:
| permissionsRole | Secure Viewer |
| space | Personal |
| resource | <resource> |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"@libre.graph.permissions.actions",
"grantedToV2",
"id",
"invitation"
],
"properties": {
"@libre.graph.permissions.actions": {
"const": [
"libre.graph/driveItem/path/read",
"libre.graph/driveItem/children/read",
"libre.graph/driveItem/basic/read"
]
},
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"id": {
"pattern": "^%permissions_id_pattern%$"
},
"invitation": {
"type": "object",
"required": ["invitedBy"],
"properties": {
"invitedBy": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
}
}
}
"""
Examples:
| resource | permissions-role |
| folderToShare | Uploader |
| folderToShare | Editor |
| folderToShare | Viewer |
| textfile.txt | File Editor |
| textfile.txt | Viewer |

@issue-10768
Scenario Outline: sharer updates share permissions role of a resource to Denied without enabling it
Given user "Alice" has created folder "folderToShare"
And user "Alice" has sent the following resource share invitation:
| resource | folderToShare |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Alice" updates the last resource share with the following properties using the Graph API:
| permissionsRole | Denied |
| space | Personal |
| resource | folderToShare |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"@libre.graph.permissions.actions",
"grantedToV2",
"id",
"invitation"
],
"properties": {
"@libre.graph.permissions.actions": {
"const": ["none"]
},
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"id": {
"pattern": "^%permissions_id_pattern%$"
},
"invitation": {
"type": "object",
"required": ["invitedBy"],
"properties": {
"invitedBy": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName", "id"],
"properties": {
"displayName": {
"const": "Alice Hansen"
},
"id": {
"pattern": "^%user_id_pattern%$"
}
}
}
}
}
}
}
}
}
"""
Examples:
| permissions-role |
| Uploader |
| Editor |
| Viewer |

@issue-10768
Scenario Outline: sharer updates share permissions role of space to Space Editor Without Versions without enabling it
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 "new-space" with the default quota using the Graph API
And user "Alice" has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Alice" updates the last drive share with the following using root endpoint of the Graph API:
| permissionsRole | Space Editor Without Versions |
| space | new-space |
| shareType | user |
| sharee | Brian |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"@libre.graph.permissions.actions",
"grantedToV2",
"id"
],
"properties": {
"@libre.graph.permissions.actions": {
"const": [
"libre.graph/driveItem/children/create",
"libre.graph/driveItem/standard/delete",
"libre.graph/driveItem/path/read",
"libre.graph/driveItem/quota/read",
"libre.graph/driveItem/content/read",
"libre.graph/driveItem/upload/create",
"libre.graph/driveItem/permissions/read",
"libre.graph/driveItem/children/read",
"libre.graph/driveItem/deleted/read",
"libre.graph/driveItem/path/update",
"libre.graph/driveItem/deleted/update",
"libre.graph/driveItem/basic/read"
]
},
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties":{
"user": {
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"const": "Brian Murphy"
},
"id": {
"pattern": "^%user_id_pattern%$"
}
}
}
}
},
"id": {
"pattern": "^u:%user_id_pattern%$"
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |

0 comments on commit 4404df6

Please sign in to comment.