Skip to content

Commit

Permalink
adding test for creating internal link share by the member of a proje…
Browse files Browse the repository at this point in the history
…ct drive
  • Loading branch information
nirajacharya2 committed Jun 21, 2024
1 parent 1af8050 commit 97c029b
Showing 1 changed file with 389 additions and 1 deletion.
390 changes: 389 additions & 1 deletion tests/acceptance/features/apiSharingNgLinkShare/linkShare.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4027,4 +4027,392 @@ Feature: Create a link share for a resource
| createOnly | view |
| createOnly | edit |
| createOnly | upload |
| blocksDownload | blocksDownload |
| blocksDownload | blocksDownload |

@issue-8960
Scenario Outline: create an internal link share by a member of a project space drive using root endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Brian" creates the following space link share using root endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"hasPassword",
"id",
"link"
],
"properties": {
"hasPassword": {
"const": false
},
"id": {
"pattern": "^[a-zA-Z]{15}$"
},
"link": {
"type": "object",
"required": [
"@libre.graph.displayName",
"@libre.graph.quickLink",
"preventsDownload",
"type",
"webUrl"
],
"properties": {
"@libre.graph.displayName": {
"const": ""
},
"@libre.graph.quickLink": {
"const": false
},
"preventsDownload": {
"const": false
},
"type": {
"const": "internal"
},
"webUrl": {
"type": "string",
"pattern": "^%base_url%/s/[a-zA-Z]{15}$"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

@issue-8960
Scenario Outline: create an internal link share by a member of a project space drive using permissions endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Brian" creates the following space link share using permissions endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"hasPassword",
"id",
"link"
],
"properties": {
"hasPassword": {
"const": false
},
"id": {
"pattern": "^[a-zA-Z]{15}$"
},
"link": {
"type": "object",
"required": [
"@libre.graph.displayName",
"@libre.graph.quickLink",
"preventsDownload",
"type",
"webUrl"
],
"properties": {
"@libre.graph.displayName": {
"const": ""
},
"@libre.graph.quickLink": {
"const": false
},
"preventsDownload": {
"const": false
},
"type": {
"const": "internal"
},
"webUrl": {
"type": "string",
"pattern": "^%base_url%/s/[a-zA-Z]{15}$"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

@issue-8960
Scenario Outline: create an internal quick link share by a member of a project space drive using root endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| quickLink | true |
When user "Brian" creates the following space link share using root endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
| quickLink | true |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"hasPassword",
"id",
"link"
],
"properties": {
"hasPassword": {
"const": false
},
"id": {
"pattern": "^[a-zA-Z]{15}$"
},
"link": {
"type": "object",
"required": [
"@libre.graph.displayName",
"@libre.graph.quickLink",
"preventsDownload",
"type",
"webUrl"
],
"properties": {
"@libre.graph.displayName": {
"const": ""
},
"@libre.graph.quickLink": {
"const": true
},
"preventsDownload": {
"const": false
},
"type": {
"const": "internal"
},
"webUrl": {
"type": "string",
"pattern": "^%base_url%/s/[a-zA-Z]{15}$"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

@issue-8960
Scenario Outline: create an internal quick link share by a member of a project space drive using permissions endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
| quickLink | true |
When user "Brian" creates the following space link share using permissions endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
| quickLink | true |
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"hasPassword",
"id",
"link"
],
"properties": {
"hasPassword": {
"const": false
},
"id": {
"pattern": "^[a-zA-Z]{15}$"
},
"link": {
"type": "object",
"required": [
"@libre.graph.displayName",
"@libre.graph.quickLink",
"preventsDownload",
"type",
"webUrl"
],
"properties": {
"@libre.graph.displayName": {
"const": ""
},
"@libre.graph.quickLink": {
"const": true
},
"preventsDownload": {
"const": false
},
"type": {
"const": "internal"
},
"webUrl": {
"type": "string",
"pattern": "^%base_url%/s/[a-zA-Z]{15}$"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

@issue-8960
Scenario Outline: try to create an internal link share by a member of a project space drive with password using root endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Brian" creates the following space link share using root endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
| quickLink | true |
| password | %public% |
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",
"message"
],
"properties": {
"code": {
"type": "string",
"pattern": "invalidRequest"
},
"message": {
"const": "password is redundant for the internal link"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

@issue-8960
Scenario Outline: try to create an internal link share by a member of a project space drive with password using permissions endpoint
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 "projectSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "projectSpace" with content "to share" to "textfile.txt"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has sent the following space share invitation:
| space | projectSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | <permissions-role> |
When user "Brian" creates the following space link share using permissions endpoint of the Graph API:
| space | projectSpace |
| permissionsRole | internal |
| quickLink | true |
| password | %public% |
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",
"message"
],
"properties": {
"code": {
"type": "string",
"pattern": "invalidRequest"
},
"message": {
"const": "password is redundant for the internal link"
}
}
}
}
}
"""
Examples:
| permissions-role |
| Space Viewer |
| Space Editor |
| Manager |
| Secure viewer |

0 comments on commit 97c029b

Please sign in to comment.