diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 61ee78e70..504b1a8c0 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -285,11 +285,8 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSpacesDavOperation/moveByFileId.feature:464](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L464) - [apiSpacesDavOperation/moveByFileId.feature:465](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L465) -### [Delete resharing tests ](https://github.com/owncloud/ocis/pull/8704) -- [apiSpacesShares/shareSubItemOfSpace.feature:119](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L119) -- [apiSpacesShares/shareSubItemOfSpace.feature:132](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L132) -- [apiSpacesShares/shareSubItemOfSpace.feature:145](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L145) -- [apiSpacesShares/shareSubItemOfSpace.feature:156](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L156) +### [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) - 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. diff --git a/tests/acceptance/features/apiReshare/resharing.feature b/tests/acceptance/features/apiReshare/resharing.feature index 23ae0c42a..1896d6a8b 100644 --- a/tests/acceptance/features/apiReshare/resharing.feature +++ b/tests/acceptance/features/apiReshare/resharing.feature @@ -92,4 +92,52 @@ Feature: re-share resources | ocs_api_version | ocs_status_code | http_status_code | | 1 | 403 | 200 | | 2 | 403 | 403 | - \ No newline at end of file + + @issue-enterprise-6423 + Scenario Outline: user cannot share items in the project space with share permission + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And using spaces DAV path + And user "Alice" has created a space "project1" with the default quota using the Graph API + And user "Alice" has created a folder "folder" in space "project1" + And user "Alice" has shared a space "project1" with settings: + | shareWith | Brian | + | role | viewer | + When user "Alice" creates a share inside of space "project1" with settings: + | path | folder | + | shareWith | Brian | + | role | custom | + | permissions | | + Then the HTTP status code should be "400" + And the OCS status code should be "400" + And the OCS status message should be "resharing not supported" + Examples: + | permissions | description | + | 19 | share + view + edit | + | 21 | share + view + create | + | 23 | share + view + create + edit | + | 25 | share + view + delete | + | 27 | share + view + edit + delete | + | 29 | share + view + create + delete | + | 31 | share + view + create + edit + delete | + + @issue-enterprise-6423 + Scenario Outline: user cannot share items in the personal space with share permission + Given user "Alice" has uploaded file with content "some content" to "/file.txt" + When user "Alice" creates a share inside of space "Alice Hansen" with settings: + | path | file.txt | + | shareWith | Brian | + | role | custom | + | permissions | | + Then the HTTP status code should be "400" + And the OCS status code should be "400" + And the OCS status message should be "resharing not supported" + Examples: + | permissions | description | + | 19 | share + view + edit | + | 21 | share + view + create | + | 23 | share + view + create + edit | + | 25 | share + view + delete | + | 27 | share + view + edit + delete | + | 29 | share + view + create + delete | + | 31 | share + view + create + edit + delete | + diff --git a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature index af6c1ef9a..7eb6b4578 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature @@ -124,6 +124,7 @@ Feature: Share a file or folder that is inside a space | expireDate | 2042-01-01T23:59:59+0100 | When user "Alice" changes the last share with settings: | expireDate | 2044-01-01T23:59:59.999+01:00 | + | role | viewer | Then the HTTP status code should be "200" And the information about the last share for user "Brian" should include | expiration | 2044-01-01 | @@ -136,12 +137,25 @@ Feature: Share a file or folder that is inside a space | role | viewer | | expireDate | 2042-01-01T23:59:59+0100 | When user "Alice" changes the last share with settings: - | expireDate | | + | expireDate | | + | role | viewer | Then the HTTP status code should be "200" And the information about the last share for user "Brian" should include | expiration | | + Scenario: user cannot delete share role + Given using 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 | + 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 | @@ -165,50 +179,3 @@ Feature: Share a file or folder that is inside a space When user "Alice" expires the last share Then the HTTP status code should be "200" And as "Brian" folder "Shares/folder" should not exist - - @issue-enterprise-6423 @env-config - Scenario Outline: user cannot share items in the project space with share permission if resharing is denied - Given the config "OCIS_ENABLE_RESHARING" has been set to "false" - And user "Alice" has shared a space "share sub-item" with settings: - | shareWith | Brian | - | role | viewer | - When user "Alice" creates a share inside of space "share sub-item" with settings: - | path | folder | - | shareWith | Bob | - | role | custom | - | permissions | | - Then the HTTP status code should be "400" - And the OCS status code should be "400" - And the OCS status message should be "resharing not supported" - Examples: - | permissions | description | - | 19 | view + edit | - | 21 | view + create | - | 23 | view + create + edit | - | 25 | view + delete | - | 27 | view + edit + delete | - | 29 | view + create + delete | - | 31 | view + create + edit +delete | - - - @issue-enterprise-6423 @env-config - Scenario Outline: user cannot share items in the personal space with share permission if resharing is denied - Given the config "OCIS_ENABLE_RESHARING" has been set to "false" - And user "Alice" has uploaded file with content "some content" to "/file.txt" - When user "Alice" creates a share inside of space "Alice Hansen" with settings: - | path | file.txt | - | shareWith | Bob | - | role | custom | - | permissions | | - Then the HTTP status code should be "400" - And the OCS status code should be "400" - And the OCS status message should be "resharing not supported" - Examples: - | permissions | description | - | 19 | view + edit | - | 21 | view + create | - | 23 | view + create + edit | - | 25 | view + delete | - | 27 | view + edit + delete | - | 29 | view + create + delete | - | 31 | view + create + edit +delete | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index d79736661..b01e5504e 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -2338,6 +2338,7 @@ class SpacesContext implements Context { public function userExpiresLastResourceShare(string $user): 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)); }