mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
Merge pull request #9140 from owncloud/use-sharingNG-in-given-steps-apiSpacesShares-suite
[full-ci] [tests-only] Use sharing ng in given steps api spaces shares suite
This commit is contained in:
@@ -294,7 +294,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
|
||||
|
||||
### [500 when deleting share role](https://github.com/owncloud/ocis/issues/8747)
|
||||
|
||||
- [apiSpacesShares/shareSubItemOfSpace.feature:147](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L147)
|
||||
- [apiSpacesShares/shareSubItemOfSpace.feature:159](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L159)
|
||||
|
||||
- Note: always have an empty line at the end of this file.
|
||||
The bash script that processes this file requires that the last line has a newline on the end.
|
||||
|
||||
@@ -114,9 +114,11 @@ Feature: Share spaces
|
||||
|
||||
|
||||
Scenario Outline: user with manager role can share a space to another user
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
When user "Brian" shares a space "share space" with settings:
|
||||
| shareWith | Bob |
|
||||
| role | <space-role> |
|
||||
@@ -132,9 +134,11 @@ Feature: Share spaces
|
||||
|
||||
@skipOnRevaMaster
|
||||
Scenario Outline: user with editor or viewer role cannot share a space to another user
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Brian" shares a space "share space" with settings:
|
||||
| shareWith | Bob |
|
||||
| role | <share-space-role> |
|
||||
@@ -143,54 +147,60 @@ Feature: Share spaces
|
||||
And the OCS status message should be "No share permission"
|
||||
And the user "Bob" should not have a space called "share space"
|
||||
Examples:
|
||||
| space-role | share-space-role |
|
||||
| editor | manager |
|
||||
| editor | editor |
|
||||
| editor | viewer |
|
||||
| viewer | manager |
|
||||
| viewer | editor |
|
||||
| viewer | viewer |
|
||||
| space-role | share-space-role |
|
||||
| Space Editor | manager |
|
||||
| Space Editor | editor |
|
||||
| Space Editor | viewer |
|
||||
| Space Viewer | manager |
|
||||
| Space Viewer | editor |
|
||||
| Space Viewer | viewer |
|
||||
|
||||
|
||||
Scenario Outline: space manager can change the role of space members
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Alice" shares a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <new-space-role> |
|
||||
| shareWith | Brian |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
And the OCS status code should be "200"
|
||||
And the user "Alice" should have a space called "share space" granted to "Brian" with role "<new-space-role>"
|
||||
And the user "Alice" should have a space called "share space" granted to "Brian" with role "<share-space-role>"
|
||||
Examples:
|
||||
| space-role | new-space-role |
|
||||
| editor | manager |
|
||||
| editor | viewer |
|
||||
| viewer | manager |
|
||||
| viewer | editor |
|
||||
| manager | editor |
|
||||
| manager | viewer |
|
||||
| space-role | share-space-role |
|
||||
| Space Editor | manager |
|
||||
| Space Editor | viewer |
|
||||
| Space Viewer | manager |
|
||||
| Space Viewer | editor |
|
||||
| Manager | editor |
|
||||
| Manager | viewer |
|
||||
|
||||
@skipOnRevaMaster
|
||||
Scenario Outline: user without manager role cannot change the role of space members
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Bob |
|
||||
| role | viewer |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Bob |
|
||||
| shareType | user |
|
||||
| permissionsRole | Space Viewer |
|
||||
When user "Brian" updates the space "share space" with settings:
|
||||
| shareWith | Bob |
|
||||
| role | <new-space-role> |
|
||||
| shareWith | Bob |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "403"
|
||||
And the OCS status code should be "403"
|
||||
And the user "Alice" should have a space called "share space" granted to "Bob" with role "viewer"
|
||||
Examples:
|
||||
| space-role | new-space-role |
|
||||
| editor | manager |
|
||||
| editor | viewer |
|
||||
| viewer | manager |
|
||||
| viewer | editor |
|
||||
| space-role | share-space-role |
|
||||
| Space Editor | manager |
|
||||
| Space Editor | viewer |
|
||||
| Space Viewer | manager |
|
||||
| Space Viewer | editor |
|
||||
|
||||
|
||||
Scenario Outline: user shares a space with a group
|
||||
@@ -214,28 +224,30 @@ Feature: Share spaces
|
||||
Scenario Outline: user has no access to the space if access for the group has been removed
|
||||
Given group "group2" has been created
|
||||
And the administrator has added a user "Brian" to the group "group2" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | group2 |
|
||||
| shareType | 8 |
|
||||
| role | <space-role> |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | group2 |
|
||||
| shareType | group |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Alice" unshares a space "share space" to group "group2"
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should not have a space called "share space"
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role |
|
||||
| Manager |
|
||||
| Space Editor |
|
||||
| Space Viewer |
|
||||
|
||||
|
||||
Scenario: user has no access to the space if he has been removed from the group
|
||||
Given group "group2" has been created
|
||||
And the administrator has added a user "Brian" to the group "group2" using the Graph API
|
||||
And the administrator has added a user "Bob" to the group "group2" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | group2 |
|
||||
| shareType | 8 |
|
||||
| role | editor |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | group2 |
|
||||
| shareType | group |
|
||||
| permissionsRole | Space Editor |
|
||||
When the administrator removes the following users from the following groups using the Graph API
|
||||
| username | groupname |
|
||||
| Brian | group2 |
|
||||
@@ -248,10 +260,11 @@ Feature: Share spaces
|
||||
Given group "group2" has been created
|
||||
And the administrator has added a user "Brian" to the group "group2" using the Graph API
|
||||
And the administrator has added a user "Bob" to the group "group2" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | group2 |
|
||||
| shareType | 8 |
|
||||
| role | editor |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | group2 |
|
||||
| shareType | group |
|
||||
| permissionsRole | Space Editor |
|
||||
When the administrator deletes group "group2" using the Graph API
|
||||
Then the HTTP status code should be "204"
|
||||
And the user "Bob" should not have a space called "share space"
|
||||
@@ -261,10 +274,11 @@ Feature: Share spaces
|
||||
Scenario: user increases permissions for one member of the group or for the entire group
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| role | viewer |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | sales |
|
||||
| shareType | group |
|
||||
| permissionsRole | Space Viewer |
|
||||
When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API
|
||||
Then the HTTP status code should be "403"
|
||||
When user "Alice" shares a space "share space" with settings:
|
||||
@@ -278,9 +292,11 @@ Feature: Share spaces
|
||||
Scenario: user increases permissions for the group, so the user's permissions are increased
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | viewer |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Space Viewer |
|
||||
When user "Brian" uploads a file inside space "share space" with content "Test" to "test.txt" using the WebDAV API
|
||||
Then the HTTP status code should be "403"
|
||||
When user "Alice" shares a space "share space" with settings:
|
||||
@@ -324,128 +340,137 @@ Feature: Share spaces
|
||||
|
||||
|
||||
Scenario Outline: update the expiration date of a space in user share
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" updates the space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| expireDate | 2044-01-01T23:59:59.999+01:00 |
|
||||
| role | <space-role> |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should have a space called "share space" granted to user "Brian" with role "<space-role>" and expiration date "2044-01-01"
|
||||
And the user "Brian" should have a space called "share space" granted to user "Brian" with role "<share-space-role>" and expiration date "2044-01-01"
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role | share-space-role |
|
||||
| Manager | manager |
|
||||
| Space Editor | editor |
|
||||
| Space Viewer | viewer |
|
||||
|
||||
|
||||
Scenario Outline: update the expiration date of a space in group share
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | sales |
|
||||
| shareType | group |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" updates the space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| expireDate | 2044-01-01T23:59:59.999+01:00 |
|
||||
| role | <space-role> |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should have a space called "share space" granted to group "sales" with role "<space-role>" and expiration date "2044-01-01"
|
||||
And the user "Brian" should have a space called "share space" granted to group "sales" with role "<share-space-role>" and expiration date "2044-01-01"
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role | share-space-role |
|
||||
| Manager | manager |
|
||||
| Space Editor | editor |
|
||||
| Space Viewer | viewer |
|
||||
|
||||
|
||||
Scenario Outline: delete the expiration date of a space in user share
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" updates the space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| expireDate | |
|
||||
| role | <space-role> |
|
||||
| shareWith | Brian |
|
||||
| expireDate | |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should have a space called "share space" granted to user "Brian" with role "<space-role>" and expiration date ""
|
||||
And the user "Brian" should have a space called "share space" granted to user "Brian" with role "<share-space-role>" and expiration date ""
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role | share-space-role |
|
||||
| Manager | manager |
|
||||
| Space Editor | editor |
|
||||
| Space Viewer | viewer |
|
||||
|
||||
|
||||
Scenario Outline: delete the expiration date of a space in group share
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | sales |
|
||||
| shareType | group |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" updates the space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| expireDate | |
|
||||
| role | <space-role> |
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| expireDate | |
|
||||
| role | <share-space-role> |
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should have a space called "share space" granted to group "sales" with role "<space-role>" and expiration date ""
|
||||
And the user "Brian" should have a space called "share space" granted to group "sales" with role "<share-space-role>" and expiration date ""
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role | share-space-role |
|
||||
| Manager | manager |
|
||||
| Space Editor | editor |
|
||||
| Space Viewer | viewer |
|
||||
|
||||
|
||||
Scenario Outline: check the end of expiration of a space in user share
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" expires the user share of space "share space" for user "Brian"
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should not have a space called "share space"
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role |
|
||||
| Manager |
|
||||
| Space Editor |
|
||||
| Space Viewer |
|
||||
|
||||
|
||||
Scenario Outline: check the end of expiration of a space in group share
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| role | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59+0100 |
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | sales |
|
||||
| shareType | group |
|
||||
| permissionsRole | <space-role> |
|
||||
| expireDate | 2042-03-25T23:59:59.000Z |
|
||||
When user "Alice" expires the group share of space "share space" for group "sales"
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should not have a space called "share space"
|
||||
Examples:
|
||||
| space-role |
|
||||
| manager |
|
||||
| editor |
|
||||
| viewer |
|
||||
| space-role |
|
||||
| Manager |
|
||||
| Space Editor |
|
||||
| Space Viewer |
|
||||
|
||||
|
||||
Scenario Outline: user cannot share the personal space to an other user
|
||||
Given the administrator has assigned the role "<space-role>" to user "Brian" using the Graph API
|
||||
And user "Brian" shares a space "Brian Murphy" with settings:
|
||||
Given the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API
|
||||
When user "Brian" shares a space "Brian Murphy" with settings:
|
||||
| shareWith | Bob |
|
||||
| role | viewer |
|
||||
Then the HTTP status code should be "400"
|
||||
And the OCS status message should be "can not add members to personal spaces"
|
||||
And the user "Bob" should not have a space called "Brian Murphy"
|
||||
Examples:
|
||||
| space-role |
|
||||
| user-role |
|
||||
| Space Admin |
|
||||
| Admin |
|
||||
| User |
|
||||
@@ -454,7 +479,7 @@ Feature: Share spaces
|
||||
Scenario: user cannot share the personal space to a group
|
||||
Given group "sales" has been created
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" shares a space "Alice Hansen" with settings:
|
||||
When user "Alice" shares a space "Alice Hansen" with settings:
|
||||
| shareWith | sales |
|
||||
| shareType | 8 |
|
||||
| role | manager |
|
||||
@@ -464,9 +489,11 @@ Feature: Share spaces
|
||||
|
||||
|
||||
Scenario: last space manager cannot change his role
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
When user "Alice" updates the space "share space" with settings:
|
||||
| shareWith | Alice |
|
||||
| role | editor |
|
||||
|
||||
@@ -83,9 +83,11 @@ Feature: Share spaces via link
|
||||
|
||||
@skipOnRevaMaster
|
||||
Scenario Outline: user without manager role cannot share a space to public via link
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Brian" creates a public link share of the space "share space" with settings:
|
||||
| permissions | 1 |
|
||||
Then the HTTP status code should be "403"
|
||||
@@ -93,15 +95,17 @@ Feature: Share spaces via link
|
||||
And the OCS status message should be "No share permission"
|
||||
And for user "Alice" the space "share space" should not contain the last created public link
|
||||
Examples:
|
||||
| space-role |
|
||||
| viewer |
|
||||
| editor |
|
||||
| space-role |
|
||||
| Space Viewer |
|
||||
| Space Editor |
|
||||
|
||||
|
||||
Scenario: user with manager role can share a space to public via link
|
||||
Given user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
When user "Brian" creates a public link share of the space "share space" with settings:
|
||||
| permissions | 1 |
|
||||
| password | %public% |
|
||||
@@ -132,28 +136,30 @@ Feature: Share spaces via link
|
||||
|
||||
Scenario Outline: space admin removes password of a public link share of a space (read/invite permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has created a public link share of the space "share space" with settings:
|
||||
| permissions | <permissions> |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | view |
|
||||
| password | %public% |
|
||||
When user "Alice" updates the last public link share using the sharing API with
|
||||
| permissions | <permissions> |
|
||||
| password | |
|
||||
| permissions | 1 |
|
||||
| password | |
|
||||
Then the HTTP status code should be "200"
|
||||
And the OCS status code should be "<ocs-status-code>"
|
||||
And the OCS status message should be "OK"
|
||||
Examples:
|
||||
| ocs-api-version | ocs-status-code | permissions |
|
||||
| 1 | 100 | 1 |
|
||||
| 1 | 100 | 0 |
|
||||
| 2 | 200 | 1 |
|
||||
| 2 | 200 | 0 |
|
||||
| ocs-api-version | ocs-status-code |
|
||||
| 1 | 100 |
|
||||
| 2 | 200 |
|
||||
|
||||
|
||||
Scenario Outline: space admin tries to remove password of a public link share of a space (various permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has created a public link share of the space "share space" with settings:
|
||||
| permissions | <permissions> |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | <permissions-role> |
|
||||
| password | %public% |
|
||||
When user "Alice" updates the last public link share using the sharing API with
|
||||
| permissions | <permissions> |
|
||||
| password | |
|
||||
@@ -161,20 +167,22 @@ Feature: Share spaces via link
|
||||
And the OCS status code should be "400"
|
||||
And the OCS status message should be "missing required password"
|
||||
Examples:
|
||||
| ocs-api-version | permissions | http-status-code |
|
||||
| 1 | 5 | 200 |
|
||||
| 2 | 5 | 400 |
|
||||
| 1 | 15 | 200 |
|
||||
| 2 | 15 | 400 |
|
||||
| 1 | 4 | 200 |
|
||||
| 2 | 4 | 400 |
|
||||
| ocs-api-version | permissions | http-status-code | permissions-role |
|
||||
| 1 | 5 | 200 | upload |
|
||||
| 2 | 5 | 400 | upload |
|
||||
| 1 | 15 | 200 | edit |
|
||||
| 2 | 15 | 400 | edit |
|
||||
| 1 | 4 | 200 | createOnly |
|
||||
| 2 | 4 | 400 | createOnly |
|
||||
|
||||
|
||||
Scenario Outline: space admin removes password of a public link share of a space (invite permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has created a public link share of the space "share space" with settings:
|
||||
| permissions | 1 |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | view |
|
||||
| password | %public% |
|
||||
When user "Alice" updates the last public link share using the sharing API with
|
||||
| permissions | 0 |
|
||||
| password | |
|
||||
@@ -189,12 +197,16 @@ Feature: Share spaces via link
|
||||
|
||||
Scenario Outline: space manager tries to remove password of a public link share of a space (read permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
And user "Brian" has created a public link share of the space "share space" with settings:
|
||||
| permissions | 1 |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
And user "Brian" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | view |
|
||||
| password | %public% |
|
||||
When user "Brian" updates the last public link share using the sharing API with
|
||||
| permissions | 1 |
|
||||
| password | |
|
||||
@@ -209,12 +221,16 @@ Feature: Share spaces via link
|
||||
|
||||
Scenario Outline: space manager tries to remove password of a public link share of a space (various permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
And user "Brian" has created a public link share of the space "share space" with settings:
|
||||
| permissions | <permissions> |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
And user "Brian" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | <permissions-role> |
|
||||
| password | %public% |
|
||||
When user "Brian" updates the last public link share using the sharing API with
|
||||
| permissions | <permissions> |
|
||||
| password | |
|
||||
@@ -222,23 +238,27 @@ Feature: Share spaces via link
|
||||
And the OCS status code should be "400"
|
||||
And the OCS status message should be "missing required password"
|
||||
Examples:
|
||||
| ocs-api-version | permissions | http-status-code |
|
||||
| 1 | 5 | 200 |
|
||||
| 2 | 5 | 400 |
|
||||
| 1 | 15 | 200 |
|
||||
| 2 | 15 | 400 |
|
||||
| 1 | 4 | 200 |
|
||||
| 2 | 4 | 400 |
|
||||
| ocs-api-version | permissions | http-status-code | permissions-role |
|
||||
| 1 | 5 | 200 | upload |
|
||||
| 2 | 5 | 400 | upload |
|
||||
| 1 | 15 | 200 | edit |
|
||||
| 2 | 15 | 400 | edit |
|
||||
| 1 | 4 | 200 | createOnly |
|
||||
| 2 | 4 | 400 | createOnly |
|
||||
|
||||
|
||||
Scenario Outline: space manager removes password of a public link share of a space (invite permission)
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
And user "Brian" has created a public link share of the space "share space" with settings:
|
||||
| permissions | 1 |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
And user "Brian" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | view |
|
||||
| password | %public% |
|
||||
When user "Brian" updates the last public link share using the sharing API with
|
||||
| permissions | 0 |
|
||||
| password | |
|
||||
@@ -253,12 +273,16 @@ Feature: Share spaces via link
|
||||
|
||||
Scenario Outline: space member tries to remove the password of a public link share of a space
|
||||
Given using OCS API version "<ocs-api-version>"
|
||||
And user "Alice" has shared a space "share space" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
And user "Alice" has created a public link share of the space "share space" with settings:
|
||||
| permissions | <permissions> |
|
||||
| password | %public% |
|
||||
And using SharingNG
|
||||
And user "Alice" has sent the following space share invitation:
|
||||
| space | share space |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
And user "Alice" has created the following space link share:
|
||||
| space | share space |
|
||||
| permissionsRole | <permissions-role> |
|
||||
| password | %public% |
|
||||
When user "Brian" updates the last public link share using the sharing API with
|
||||
| permissions | <permissions> |
|
||||
| password | |
|
||||
@@ -266,24 +290,20 @@ Feature: Share spaces via link
|
||||
And the OCS status code should be "997"
|
||||
And the OCS status message should be "missing permissions to update share"
|
||||
Examples:
|
||||
| ocs-api-version | http-status-code | space-role | permissions |
|
||||
| 1 | 200 | viewer | 1 |
|
||||
| 2 | 401 | viewer | 1 |
|
||||
| 1 | 200 | viewer | 5 |
|
||||
| 2 | 401 | viewer | 5 |
|
||||
| 1 | 200 | viewer | 15 |
|
||||
| 2 | 401 | viewer | 15 |
|
||||
| 1 | 200 | viewer | 4 |
|
||||
| 2 | 401 | viewer | 4 |
|
||||
| 1 | 200 | viewer | 0 |
|
||||
| 2 | 401 | viewer | 0 |
|
||||
| 1 | 200 | editor | 1 |
|
||||
| 2 | 401 | editor | 1 |
|
||||
| 1 | 200 | editor | 5 |
|
||||
| 2 | 401 | editor | 5 |
|
||||
| 1 | 200 | editor | 15 |
|
||||
| 2 | 401 | editor | 15 |
|
||||
| 1 | 200 | editor | 4 |
|
||||
| 2 | 401 | editor | 4 |
|
||||
| 1 | 200 | editor | 0 |
|
||||
| 2 | 401 | editor | 0 |
|
||||
| ocs-api-version | http-status-code | space-role | permissions | permissions-role |
|
||||
| 1 | 200 | Space Viewer | 1 | view |
|
||||
| 2 | 401 | Space Viewer | 1 | view |
|
||||
| 1 | 200 | Space Viewer | 5 | upload |
|
||||
| 2 | 401 | Space Viewer | 5 | upload |
|
||||
| 1 | 200 | Space Viewer | 15 | edit |
|
||||
| 2 | 401 | Space Viewer | 15 | edit |
|
||||
| 1 | 200 | Space Viewer | 4 | createOnly |
|
||||
| 2 | 401 | Space Viewer | 4 | createOnly |
|
||||
| 1 | 200 | Space Editor | 1 | view |
|
||||
| 2 | 401 | Space Editor | 1 | view |
|
||||
| 1 | 200 | Space Editor | 5 | upload |
|
||||
| 2 | 401 | Space Editor | 5 | upload |
|
||||
| 1 | 200 | Space Editor | 15 | edit |
|
||||
| 2 | 401 | Space Editor | 15 | edit |
|
||||
| 1 | 200 | Space Editor | 4 | createOnly |
|
||||
| 2 | 401 | Space Editor | 4 | createOnly |
|
||||
|
||||
@@ -41,9 +41,11 @@ Feature: Share a file or folder that is inside a space
|
||||
|
||||
|
||||
Scenario Outline: user participant of the project space with manager role can share an entity to another user
|
||||
Given user "Alice" has shared a space "share sub-item" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | manager |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Manager |
|
||||
When user "Brian" creates a share inside of space "share sub-item" with settings:
|
||||
| path | <resource> |
|
||||
| shareWith | Bob |
|
||||
@@ -64,9 +66,11 @@ Feature: Share a file or folder that is inside a space
|
||||
|
||||
@skipOnRevaMaster
|
||||
Scenario Outline: user participant of the project space without space manager role cannot share an entity to another user
|
||||
Given user "Alice" has shared a space "share sub-item" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Brian" creates a share inside of space "share sub-item" with settings:
|
||||
| path | <resource> |
|
||||
| shareWith | Bob |
|
||||
@@ -75,17 +79,19 @@ Feature: Share a file or folder that is inside a space
|
||||
And the OCS status code should be "403"
|
||||
And the OCS status message should be "No share permission"
|
||||
Examples:
|
||||
| resource | space-role |
|
||||
| folder | editor |
|
||||
| file.txt | editor |
|
||||
| file.txt | viewer |
|
||||
| folder | viewer |
|
||||
| resource | space-role |
|
||||
| folder | Space Editor |
|
||||
| file.txt | Space Editor |
|
||||
| file.txt | Space Viewer |
|
||||
| folder | Space Viewer |
|
||||
|
||||
|
||||
Scenario Outline: user participant of the project space can see the created resources share
|
||||
Given user "Alice" has shared a space "share sub-item" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <space-role> |
|
||||
Given user "Alice" has sent the following space share invitation:
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <space-role> |
|
||||
When user "Alice" creates a share inside of space "share sub-item" with settings:
|
||||
| path | file.txt |
|
||||
| shareWith | Bob |
|
||||
@@ -93,10 +99,10 @@ Feature: Share a file or folder that is inside a space
|
||||
Then for user "Alice" the space "share sub-item" should contain the last created share of the file "file.txt"
|
||||
And for user "Brian" the space "share sub-item" should contain the last created share of the file "file.txt"
|
||||
Examples:
|
||||
| space-role |
|
||||
| editor |
|
||||
| viewer |
|
||||
| manager |
|
||||
| space-role |
|
||||
| Space Editor |
|
||||
| Space Viewer |
|
||||
| Manager |
|
||||
|
||||
|
||||
Scenario: user shares the folder to the group
|
||||
@@ -117,11 +123,14 @@ Feature: Share a file or folder that is inside a space
|
||||
|
||||
|
||||
Scenario: user changes the expiration date
|
||||
Given user "Alice" has created a share inside of space "share sub-item" with settings:
|
||||
| path | folder |
|
||||
| shareWith | Brian |
|
||||
| role | viewer |
|
||||
| expireDate | 2042-01-01T23:59:59+0100 |
|
||||
Given using SharingNG
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expireDate | 2042-01-01T23:59:59.000Z |
|
||||
When user "Alice" changes the last share with settings:
|
||||
| expireDate | 2044-01-01T23:59:59.999+01:00 |
|
||||
| role | viewer |
|
||||
@@ -131,11 +140,14 @@ Feature: Share a file or folder that is inside a space
|
||||
|
||||
|
||||
Scenario: user deletes the expiration date
|
||||
Given user "Alice" has created a share inside of space "share sub-item" with settings:
|
||||
| path | folder |
|
||||
| shareWith | Brian |
|
||||
| role | viewer |
|
||||
| expireDate | 2042-01-01T23:59:59+0100 |
|
||||
Given using SharingNG
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expireDate | 2042-01-01T23:59:59.000Z |
|
||||
When user "Alice" changes the last share with settings:
|
||||
| expireDate | |
|
||||
| role | viewer |
|
||||
@@ -143,39 +155,47 @@ Feature: Share a file or folder that is inside a space
|
||||
And the information about the last share for user "Brian" should include
|
||||
| expiration | |
|
||||
|
||||
|
||||
@issue-8747
|
||||
Scenario: user cannot delete share role
|
||||
Given using OCS API version "<ocs_api_version>"
|
||||
And user "Alice" has created a share inside of space "share sub-item" with settings:
|
||||
| path | folder |
|
||||
| shareWith | Brian |
|
||||
| role | viewer |
|
||||
| expireDate | 2042-01-01T23:59:59+0100 |
|
||||
And using SharingNG
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expireDate | 2042-01-01T23:59:59.000Z |
|
||||
When user "Alice" changes the last share with settings:
|
||||
| role | |
|
||||
Then the HTTP status code should be "400"
|
||||
|
||||
|
||||
Scenario: check the end of expiration date in user share
|
||||
Given user "Alice" has created a share inside of space "share sub-item" with settings:
|
||||
| path | folder |
|
||||
| shareWith | Brian |
|
||||
| role | viewer |
|
||||
| expireDate | 2042-01-01T23:59:59+0100 |
|
||||
When user "Alice" expires the last share
|
||||
Given using SharingNG
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | share sub-item |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
| expireDate | 2042-01-01T23:59:59.000Z |
|
||||
When user "Alice" expires the last share of resource "folder" inside of the space "share sub-item"
|
||||
Then the HTTP status code should be "200"
|
||||
And as "Brian" folder "Shares/folder" should not exist
|
||||
|
||||
@issue-5823
|
||||
Scenario: check the end of expiration date in group share
|
||||
Given group "sales" has been created
|
||||
And using SharingNG
|
||||
And the administrator has added a user "Brian" to the group "sales" using the Graph API
|
||||
And user "Alice" has created a share inside of space "share sub-item" with settings:
|
||||
| path | folder |
|
||||
| shareWith | sales |
|
||||
| shareType | 1 |
|
||||
| role | viewer |
|
||||
| expireDate | 2042-01-01T23:59:59+0100 |
|
||||
When user "Alice" expires the last share
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | folder |
|
||||
| space | share sub-item |
|
||||
| sharee | sales |
|
||||
| shareType | group |
|
||||
| permissionsRole | Viewer |
|
||||
| expireDate | 2042-01-01T23:59:59.000Z |
|
||||
When user "Alice" expires the last share of resource "folder" inside of the space "share sub-item"
|
||||
Then the HTTP status code should be "200"
|
||||
And as "Brian" folder "Shares/folder" should not exist
|
||||
|
||||
@@ -1934,10 +1934,11 @@ trait Sharing {
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userGetsTheLastShareSharedWithHimUsingTheSharingApi(string $user, TableNode $table):void {
|
||||
$user = $this->getActualUsername($user);
|
||||
$shareId = (string) $this->getLastCreatedPublicShare()->id;
|
||||
$shareId = ($this->isUsingSharingNG()) ? $this->shareNgGetLastCreatedUserGroupShareID() : $this->getLastCreatedUserGroupShareId();
|
||||
$response = $this->getShareData($user, $shareId);
|
||||
$this->checkFields($user, $table, $response);
|
||||
}
|
||||
|
||||
@@ -2244,7 +2244,8 @@ class SpacesContext implements Context {
|
||||
$this->featureContext->getStepLineRef()
|
||||
);
|
||||
$responseXml = $this->featureContext->getResponseXml($response, __METHOD__);
|
||||
$this->featureContext->addToCreatedPublicShares($responseXml->data);
|
||||
$sharer = (string) $responseXml->data->uid_owner;
|
||||
$this->featureContext->addToCreatedUserGroupshares($sharer, $responseXml->data);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -2314,7 +2315,7 @@ class SpacesContext implements Context {
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function updateSharedResource(string $user, array $rows):ResponseInterface {
|
||||
$shareId = (string) $this->featureContext->getLastCreatedPublicShare()->id;
|
||||
$shareId = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedUserGroupShareID() : $this->featureContext->getLastCreatedUserGroupShareId();
|
||||
$fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId;
|
||||
return HttpRequestHelper::sendRequest(
|
||||
$fullUrl,
|
||||
@@ -2328,17 +2329,39 @@ class SpacesContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" expires the last share$/
|
||||
* @When user :user expires the last share of resource :resource inside of the space :spaceName
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $resource
|
||||
* @param string $spaceName
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException|JsonException
|
||||
*/
|
||||
public function userExpiresLastResourceShare(string $user): void {
|
||||
public function userExpiresTheLastShareOfResourceInsideOfTheSpace(string $user, string $resource, string $spaceName): void {
|
||||
$dateTime = new DateTime('yesterday');
|
||||
$rows['expireDate'] = $dateTime->format('Y-m-d\\TH:i:sP');
|
||||
$rows['permissions'] = (string) $this->featureContext->getLastCreatedPublicShare()->permissions;
|
||||
$this->featureContext->setResponse($this->updateSharedResource($user, $rows));
|
||||
if ($this->featureContext->isUsingSharingNG()) {
|
||||
$space = $this->getSpaceByName($user, $spaceName);
|
||||
$itemId = $this->getResourceId($user, $spaceName, $resource);
|
||||
$body['expirationDateTime'] = $rows['expireDate'];
|
||||
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
|
||||
$this->featureContext->setResponse(
|
||||
GraphHelper::updateShare(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$space["id"],
|
||||
$itemId,
|
||||
\json_encode($body),
|
||||
$permissionID
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$rows['permissions'] = (string)$this->featureContext->getLastCreatedUserGroupShare()->permissions;
|
||||
$this->featureContext->setResponse($this->updateSharedResource($user, $rows));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3410,12 +3433,12 @@ class SpacesContext implements Context {
|
||||
|
||||
/**
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created public link$/
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created public link of the file "([^"]*)"$/
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created share of the file "([^"]*)"$/
|
||||
* @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created (public link|share) of the file "([^"]*)"$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $shouldOrNot (not|)
|
||||
* @param string $shareType
|
||||
* @param string $fileName
|
||||
*
|
||||
* @return void
|
||||
@@ -3426,6 +3449,7 @@ class SpacesContext implements Context {
|
||||
string $user,
|
||||
string $spaceName,
|
||||
string $shouldOrNot,
|
||||
string $shareType = 'public link',
|
||||
string $fileName = ''
|
||||
): void {
|
||||
if (!empty($fileName)) {
|
||||
@@ -3449,8 +3473,13 @@ class SpacesContext implements Context {
|
||||
if ($should) {
|
||||
Assert::assertNotEmpty($responseArray, __METHOD__ . ' Response should contain a link, but it is empty');
|
||||
foreach ($responseArray as $element) {
|
||||
$expectedLinkId = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareID() : (string) $this->featureContext->getLastCreatedPublicShare()->id;
|
||||
Assert::assertEquals($element["id"], $expectedLinkId, "link IDs are different");
|
||||
if ($shareType === 'public link') {
|
||||
$expectedLinkId = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedLinkShareID() : (string) $this->featureContext->getLastCreatedPublicShare()->id;
|
||||
Assert::assertEquals($element["id"], $expectedLinkId, "link IDs are different");
|
||||
} else {
|
||||
$expectedShareId = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedUserGroupShareID() : (string)$this->featureContext->getLastCreatedUserGroupShareId();
|
||||
Assert::assertEquals($element["id"], $expectedShareId, "share IDs are different");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Assert::assertEmpty($responseArray, __METHOD__ . ' Response should be empty');
|
||||
|
||||
Reference in New Issue
Block a user