Skip to content

Commit

Permalink
adding test for listing permission of a project drive by a member wit…
Browse files Browse the repository at this point in the history
…h viewer permission
  • Loading branch information
nirajacharya2 committed Apr 22, 2024
1 parent 520aa9a commit 54f5981
Showing 1 changed file with 165 additions and 0 deletions.
165 changes: 165 additions & 0 deletions tests/acceptance/features/apiSharingNg/listPermissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1079,3 +1079,168 @@ Feature: List a sharing permissions
| drive |
| Personal |
| Shares |


Scenario: member of a project drive with viewer permission lists the permissions of the drive
Given using spaces DAV path
And user "Brian" has been created with default attributes and without skeleton files
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 share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" lists the permissions of space "new-space" using 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",
"value"
],
"properties": {
"@libre.graph.permissions.actions.allowedValues": {
"const": [
"libre.graph/driveItem/path/read",
"libre.graph/driveItem/quota/read",
"libre.graph/driveItem/content/read",
"libre.graph/driveItem/permissions/read",
"libre.graph/driveItem/children/read",
"libre.graph/driveItem/deleted/read",
"libre.graph/driveItem/basic/read"
]
},
"@libre.graph.permissions.roles.allowedValues": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"uniqueItems": true,
"items": {
"oneOf": [
{
"type": "object",
"required": [
"@libre.graph.weight",
"description",
"displayName",
"id"
],
"properties": {
"@libre.graph.weight": {
"const": 1
},
"description": {
"const": "View and download."
},
"displayName": {
"const": "Can view"
},
"id": {
"const": "a8d5fe5e-96e3-418d-825b-534dbdf22b99"
}
}
}
]
}
},
"value": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"oneOf":[
{
"type": "object",
"required": [
"grantedToV2",
"id",
"roles"
],
"properties": {
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName","id"],
"properties": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"displayName": {
"const": "Brian Murphy"
}
}
}
}
},
"id": {
"type": "string",
"pattern": "^u:%user_id_pattern%$"
},
"roles": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "string",
"pattern": "^%role_id_pattern%$"
}
}
}
},
{
"type": "object",
"required": [
"grantedToV2",
"id",
"roles"
],
"properties": {
"grantedToV2": {
"type": "object",
"required": ["user"],
"properties": {
"user": {
"type": "object",
"required": ["displayName","id"],
"properties": {
"id": {
"type": "string",
"pattern": "^%user_id_pattern%$"
},
"displayName": {
"const": "Alice Hansen"
}
}
}
}
},
"id": {
"type": "string",
"pattern": "^u:%user_id_pattern%$"
},
"roles": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "string",
"pattern": "^%role_id_pattern%$"
}
}
}
}
]
}
}
}
}
"""

0 comments on commit 54f5981

Please sign in to comment.