create share with expirate date. refactoring code (#5424)

This commit is contained in:
Viktor Scharf
2023-02-01 09:55:51 +01:00
committed by GitHub
parent 43f01084e6
commit 486453b4c9
16 changed files with 230 additions and 1066 deletions

View File

@@ -322,63 +322,6 @@ cannot share a folder with create permission
#### Expiration date of user shares
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:52](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L52)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:53](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L53)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:76](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L76)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:77](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L77)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:102](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L102)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:103](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L103)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:128](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L128)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:129](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L129)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:279](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L279)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:280](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L280)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:301](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L301)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:302](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L302)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:323](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L323)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:324](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L324)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:346](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L346)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:347](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L347)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:363](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L363)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:364](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L364)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:380](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L380)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:381](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L381)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:576](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L576)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:577](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L577)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:599](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L599)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:600](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L600)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:601](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L601)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:602](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L602)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:603](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L603)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:624](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L624)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:625](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L625)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:626](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L626)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:627](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L627)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:628](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L628)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:629](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L629)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:630](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L630)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:631](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L631)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:632](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L632)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:633](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L633)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:634](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L634)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:635](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L635)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:656](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L656)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:657](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L657)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:658](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L658)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:659](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L659)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:660](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L660)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:661](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L661)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:682](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L682)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:683](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L683)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:684](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L684)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:685](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L685)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:686](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L686)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:687](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L687)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:708](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L708)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:709](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L709)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:732](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L732)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:733](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L733)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:756](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L756)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:757](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L757)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L34)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:35](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L35)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:86](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L86)
@@ -410,26 +353,6 @@ cannot share a folder with create permission
#### Expiration date of group shares
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:175](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L175)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:176](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L176)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:201](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L201)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:202](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L202)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:229](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L229)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:230](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L230)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:258](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L258)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:259](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L259)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:403](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L403)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:404](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L404)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:427](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L427)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:428](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L428)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:451](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L451)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:452](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L452)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:476](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L476)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:477](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L477)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:497](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L497)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:498](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L498)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:518](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L518)
- [coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature:519](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares1/createShareExpirationDate.feature#L519)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:60](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L60)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:61](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L61)
- [coreApiShareReshareToShares3/reShareWithExpiryDate.feature:116](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareReshareToShares3/reShareWithExpiryDate.feature#L116)

View File

@@ -40,7 +40,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
### [Copy or move on an existing resource doesn't create a new version but deletes instead](https://github.com/owncloud/ocis/issues/4797)
- [apiSpacesShares/moveSpaces.feature:306](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L306)
- [apiSpacesShares/copySpaces.feature:710](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L710)
- [apiSpacesShares/copySpaces.feature:748](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L748)
- [apiSpacesShares/copySpaces.feature:751](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/copySpaces.feature#L751)
### [Creating group with empty name returns status code 200](https://github.com/owncloud/ocis/issues/5050)
- [apiGraph/createGroup.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroup.feature#L40)
@@ -100,5 +100,8 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiAsyncUpload/delayPostprocessing.feature:15](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAsyncUpload/delayPostprocessing.feature#L15)
- [apiAsyncUpload/delayPostprocessing.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiAsyncUpload/delayPostprocessing.feature#L16)
#### [Sharing to a group with an expiration date does not work #5442](https://github.com/owncloud/ocis/issues/5442)
- [apiSpacesShares/shareSubItemOfSpace.feature:99](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpace.feature#L99)
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.

View File

@@ -19,7 +19,10 @@ Feature: Report test
Scenario: check the response of the found folder
Given user "Alice" shares the following entity "folderMain" inside of space "find data" with user "Brian" with role "viewer"
Given user "Alice" has created a share inside of space "find data" with settings:
| path | folderMain |
| shareWith | Brian |
| role | viewer |
And user "Brian" has accepted share "/folderMain" offered by user "Alice"
When user "Brian" searches for "SubFolder1" using the WebDAV API
Then the HTTP status code should be "207"
@@ -35,7 +38,10 @@ Feature: Report test
Scenario: check the response of the found file
Given user "Alice" shares the following entity "folderMain" inside of space "find data" with user "Brian" with role "editor"
Given user "Alice" has created a share inside of space "find data" with settings:
| path | folderMain |
| shareWith | Brian |
| role | editor |
And user "Brian" has accepted share "/folderMain" offered by user "Alice"
When user "Brian" searches for "insideTheFolder.txt" using the WebDAV API
Then the HTTP status code should be "207"

View File

@@ -31,7 +31,6 @@ Feature: A manager of the space can edit public link
| permissions | <permissions> |
| password | <password> |
| name | <linkName> |
| expireDate | <expireDate> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
@@ -44,13 +43,12 @@ Feature: A manager of the space can edit public link
| share_type | public_link |
| displayname_owner | %displayname% |
| name | <linkName> |
| expiration | <expireDate> |
And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "<password>"
And the downloaded content should be "some content"
Examples:
| permissions | expectedPermissions | password | linkName | expireDate |
| 5 | read,create | newPass | | |
| 15 | read,update,create,delete | | newName | 2042-03-25T23:59:59+0100 |
| permissions | expectedPermissions | password | linkName |
| 5 | read,create | newPass | |
| 15 | read,update,create,delete | | newName |
Scenario Outline: All members can see a created public link

View File

@@ -42,7 +42,10 @@ Feature: Search
Scenario: Brian can find data from the Shares
Given user "Alice" shares the following entity "folderMain" inside of space "find data" with user "Brian" with role "viewer"
Given user "Alice" has created a share inside of space "find data" with settings:
| path | folderMain |
| shareWith | Brian |
| role | viewer |
And user "Brian" has accepted share "/folderMain" offered by user "Alice"
When user "Brian" searches for "folder" using the WebDAV API
Then the HTTP status code should be "207"
@@ -64,7 +67,10 @@ Feature: Search
Scenario: User cannot find pending folder
Given user "Alice" shares the following entity "folderMain" inside of space "find data" with user "Brian" with role "viewer"
Given user "Alice" has created a share inside of space "find data" with settings:
| path | folderMain |
| shareWith | Brian |
| role | viewer |
When user "Brian" searches for "folder" using the WebDAV API
Then the HTTP status code should be "207"
And the search result should contain "0" entries
@@ -75,7 +81,10 @@ Feature: Search
Scenario: User cannot find declined folder
Given user "Alice" shares the following entity "folderMain" inside of space "find data" with user "Brian" with role "viewer"
Given user "Alice" has created a share inside of space "find data" with settings:
| path | folderMain |
| shareWith | Brian |
| role | viewer |
And user "Brian" has declined share "/folderMain" offered by user "Alice"
When user "Brian" searches for "folder" using the WebDAV API
Then the HTTP status code should be "207"

View File

@@ -102,7 +102,10 @@ Feature: Tag
Given user "Alice" has created the following tags for folder "folderMain" of the space "use-tag":
| folderTag |
| marketing |
And user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "viewer"
And user "Alice" has created a share inside of space "use-tag" with settings:
| path | folderMain |
| shareWith | Brian |
| role | viewer |
When user "Brian" lists all available tags via the GraphApi
Then the HTTP status code should be "200"
And the response should not contain following tags:
@@ -117,7 +120,10 @@ Feature: Tag
Scenario Outline: The recipient of the shared resource tries to create a tag
Given user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "<role>"
Given user "Alice" has created a share inside of space "use-tag" with settings:
| path | folderMain |
| shareWith | Brian |
| role | <role> |
And user "Brian" has accepted share "/folderMain" offered by user "Alice"
When user "Brian" creates the following tags for <resource> "<resourceName>" of space "Shares":
| tag in a shared resource |
@@ -139,7 +145,10 @@ Feature: Tag
Scenario Outline: The recipient of the shared resource tries to remove a tag
Given user "Alice" has shared the following entity "folderMain" inside of space "use-tag" with user "Brian" with role "<role>"
Given user "Alice" has created a share inside of space "use-tag" with settings:
| path | folderMain |
| shareWith | Brian |
| role | <role> |
And user "Alice" has created the following tags for <resource> "<resourceName>" of the space "use-tag":
| tag in a shared resource |
| second tag |

View File

@@ -731,7 +731,10 @@ Feature: copy file
And user "Alice" has created a space "Project" with the default quota using the GraphApi
And user "Alice" has created a folder "/newfolder" in space "Project"
And user "Alice" has uploaded a file inside space "Project" with content "some content" to "/newfolder/personal.txt"
And user "Alice" shares the following entity "newfolder" inside of space "Project" with user "Brian" with role "editor"
And user "Alice" creates a share inside of space "Project" with settings:
| path | newfolder |
| shareWith | Brian |
| role | editor |
And user "Brian" has accepted share "/newfolder" offered by user "Alice"
And user "Brian" has uploaded file with content "new content" to "/personal.txt"
When user "Brian" copies file "/personal.txt" from space "Personal" to "/newfolder/personal (1).txt" inside space "Shares" using the WebDAV API
@@ -751,13 +754,16 @@ Feature: copy file
And user "Alice" has created a folder "/newfolder" in space "Project"
And user "Alice" has uploaded a file inside space "Project" with content "old content version 1" to "/newfolder/personal.txt"
And user "Alice" has uploaded a file inside space "Project" with content "old content version 2" to "/newfolder/personal.txt"
And user "Alice" shares the following entity "newfolder" inside of space "Project" with user "Brian" with role "editor"
And user "Alice" creates a share inside of space "Project" with settings:
| path | newfolder |
| shareWith | Brian |
| role | editor |
And user "Brian" has accepted share "/newfolder" offered by user "Alice"
And user "Brian" has uploaded file with content "new content" to "/personal.txt"
When user "Brian" overwrites file "/personal.txt" from space "Personal" to "/newfolder/personal.txt" inside space "Shares" while copying using the WebDAV API
Then the HTTP status code should be "204"
And for user "Alice" the space "Project" should contain these entries:
| newfolder/personal.txt |
| newfolder/personal.txt |
And for user "Alice" the content of the file "/newfolder/personal.txt" of the space "Project" should be "new content"
When user "Alice" downloads version of the file "/newfolder/personal.txt" with the index "1" of the space "Project" using the WebDAV API
Then the HTTP status code should be "200"

View File

@@ -18,43 +18,58 @@ Feature: Share a file or folder that is inside a space
And user "Alice" has created a space "share sub-item" with the default quota using the GraphApi
And user "Alice" has created a folder "folder" in space "share sub-item"
And user "Alice" has uploaded a file inside space "share sub-item" with content "some content" to "file.txt"
And using new DAV path
And using new DAV path
Scenario Outline: A manager of the space can share an entity inside project space to another user with role
When user "Alice" shares the following entity "<entity>" inside of space "share sub-item" with user "Brian" with role "<role>"
And user "Alice" creates a share inside of space "share sub-item" with settings:
| path | <entity> |
| shareWith | Brian |
| role | <role> |
| expireDate | <expireDate> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
When user "Brian" accepts share "/<entity>" offered by user "Alice" using the sharing API
And as "Brian" <type> "Shares/<entity>" should exist
Then as "Brian" <type> "Shares/<entity>" should exist
And the information about the last share for user "Brian" should include
| expiration | <expiration> |
Examples:
| entity | type | role |
| folder | folder | viewer |
| folder | folder | editor |
| file.txt | file | viewer |
| file.txt | file | editor |
| entity | type | role | expireDate | expiration |
| folder | folder | viewer | | |
| folder | folder | editor | 2042-03-25T23:59:59+0100 | 2042-03-25 |
| file.txt | file | viewer | | |
| file.txt | file | editor | 2042-03-25T23:59:59+0100 | 2042-03-25 |
Scenario Outline: An user participant of the project space with manager role can share an entity to another user
Scenario Outline: A 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" to user "Brian" with role "manager"
When user "Brian" shares the following entity "<entity>" inside of space "share sub-item" with user "Bob" with role "<role>"
When user "Brian" creates a share inside of space "share sub-item" with settings:
| path | <entity> |
| shareWith | Bob |
| role | <role> |
| expireDate | <expireDate> |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
When user "Bob" accepts share "/<entity>" offered by user "Brian" using the sharing API
And as "Bob" <type> "Shares/<entity>" should exist
Then as "Bob" <type> "Shares/<entity>" should exist
And the information about the last share for user "Brian" should include
| expiration | <expiration> |
Examples:
| entity | type | role |
| folder | folder | viewer |
| folder | folder | editor |
| file.txt | file | viewer |
| file.txt | file | editor |
| entity | type | role | expireDate | expiration |
| folder | folder | viewer | 2042-03-25T23:59:59+0100 | 2042-03-25 |
| folder | folder | editor | | |
| file.txt | file | viewer | 2042-03-25T23:59:59+0100 | 2042-03-25 |
| file.txt | file | editor | | |
Scenario Outline: An user participant of the project space without space manager role cannot share an entity to another user
Scenario Outline: A 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" to user "Brian" with role "<spaceRole>"
When user "Brian" shares the following entity "<entity>" inside of space "share sub-item" with user "Bob" with role "editor"
When user "Brian" creates a share inside of space "share sub-item" with settings:
| path | <entity> |
| shareWith | Bob |
| role | editor |
Then the HTTP status code should be "<statusCode>"
And the OCS status code should be "<statusCode>"
And the OCS status message should be "<statusMessage>"
@@ -66,9 +81,12 @@ Feature: Share a file or folder that is inside a space
| folder | viewer | 404 | No share permission |
Scenario Outline: An user participant of the project space can see the created resources share
Scenario Outline: A user participant of the project space can see the created resources share
Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "<spaceRole>"
When user "Alice" shares the following entity "file.txt" inside of space "share sub-item" with user "Bob" with role "editor"
When user "Alice" creates a share inside of space "share sub-item" with settings:
| path | file.txt |
| shareWith | Bob |
| role | editor |
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:
@@ -76,3 +94,35 @@ Feature: Share a file or folder that is inside a space
| editor |
| viewer |
| manager |
Scenario: A user shares the folder to the group
Given group "sales" has been created
And the administrator has added a user "Brian" to the group "sales" using GraphApi
When user "Alice" creates 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 |
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the OCS status message should be "OK"
When user "Brian" accepts share "/folder" offered by user "Alice" using the sharing API
Then as "Brian" folder "Shares/folder" should exist
And the information about the last share for user "Brian" should include
| expiration | 2042-01-01 |
Scenario: A 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 |
And user "Brian" has accepted share "/folder" offered by user "Alice"
When user "Alice" changes the last share with settings:
| expireDate | 2044-01-01T23:59:59.999+01:00 |
Then the HTTP status code should be "200"
And the information about the last share for user "Brian" should include
| expiration | 2044-01-01 |

View File

@@ -1030,14 +1030,7 @@ trait Sharing {
$this->shareFields
);
$bodyRows = $body->getRowsHash();
if (\array_key_exists('expireDate', $bodyRows)) {
$dateModification = $bodyRows['expireDate'];
if (!empty($bodyRows['expireDate'])) {
$bodyRows['expireDate'] = \date('Y-m-d', \strtotime($dateModification));
} else {
$bodyRows['expireDate'] = '';
}
}
if (\array_key_exists('password', $bodyRows)) {
$bodyRows['password'] = $this->getActualPassword($bodyRows['password']);
}
@@ -1283,7 +1276,7 @@ trait Sharing {
}
Assert::assertIsObject($data, __METHOD__ . " data not found in response XML");
$dateFieldsArrayToConvert = ['expiration', 'original_date', 'new_date'];
$dateFieldsArrayToConvert = ['original_date', 'new_date'];
//do not try to convert empty date
if ((string) \in_array($field, \array_merge($dateFieldsArrayToConvert)) && !empty($contentExpected)) {
$timestamp = \strtotime($contentExpected, $this->getServerShareTimeFromLastResponse());
@@ -1305,6 +1298,10 @@ trait Sharing {
if (isset($element->$field)) {
$fieldIsSet = true;
$value = (string) $element->$field;
// convert expiration to Y-m-d format. bug #5424
if ($field === "expiration") {
$value = (preg_split("/[\sT]+/", $value))[0];
}
if ($this->doesFieldValueMatchExpectedContent(
$field,
$value,
@@ -2386,6 +2383,21 @@ trait Sharing {
);
}
/**
* @When the information about the last share for user :user should include
*
* @param string $user
* @param TableNode $table
*
* @return void
*/
public function userGetsTheLastShareSharedWithHimUsingTheSharingApi(string $user, $table):void {
$user = $this->getActualUsername($user);
$shareId = $this->getLastPublicLinkShareId();
$this->getShareData($user, $shareId);
$this->checkFields($user, $table);
}
/**
* @When /^user "([^"]*)" gets the (|pending)\s?(user|group|user and group|public link) shares shared with him using the sharing API$/
*

View File

@@ -327,7 +327,7 @@ class SpacesContext implements Context {
}
/**
* The method returns folderId
* The method returns "fileid" from the PROPFIND response
*
* @param string $user
* @param string $spaceName
@@ -336,7 +336,7 @@ class SpacesContext implements Context {
* @return string
* @throws GuzzleException
*/
public function getFolderId(string $user, string $spaceName, string $folderName): string {
public function getResourceId(string $user, string $spaceName, string $folderName): string {
$space = $this->getSpaceByName($user, $spaceName);
// For a level 1 folder, the parent is space so $folderName = ''
if ($folderName === $space["name"]) {
@@ -1888,85 +1888,105 @@ class SpacesContext implements Context {
}
/**
* Request to send share of resource inside of space
* @When /^user "([^"]*)" creates a share inside of space "([^"]*)" with settings:$/
*
* @param string $user
* @param string $entity
* @param string $spaceName
* @param string $userRecipient
* @param string $role
*
* @return ResponseInterface
* @throws GuzzleException
*/
public function sendRequestForShareOfEntityInsideOfSpace(string $user, string $entity, string $spaceName, string $userRecipient, string $role): ResponseInterface {
$space = $this->getSpaceByName($user, $spaceName);
$body = [
"space_ref" => $space['id'] . "/" . $entity,
"shareType" => 0,
"shareWith" => $userRecipient,
"role" => $role
];
$fullUrl = $this->baseUrl . $this->ocsApiUrl;
return $this->sendPostRequestToUrl(
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
);
}
/**
* @When /^user "([^"]*)" shares the following entity "([^"]*)" inside of space "([^"]*)" with user "([^"]*)" with role "([^"]*)"$/
*
* @param string $user
* @param string $entity
* @param string $spaceName
* @param string $userRecipient
* @param string $role
* @param TableNode $table
*
* @return void
* @throws GuzzleException
*/
public function sharesTheFollowingEntityInsideOfSpace(
public function createShareResource(
string $user,
string $entity,
string $spaceName,
string $userRecipient,
string $role
TableNode $table
): void {
$this->featureContext->setResponse($this->sendRequestForShareOfEntityInsideOfSpace($user, $entity, $spaceName, $userRecipient, $role));
$rows = $table->getRowsHash();
$rows["path"] = \array_key_exists("path", $rows) ? $rows["path"] : null;
$rows["shareType"] = \array_key_exists("shareType", $rows) ? $rows["shareType"] : 0;
$rows["role"] = \array_key_exists("role", $rows) ? $rows["role"] : 'viewer';
$rows["expireDate"] = \array_key_exists("expireDate", $rows) ? $rows["expireDate"] : null;
$body = [
"space_ref" => $this->getResourceId($user, $spaceName, $rows["path"]),
"shareWith" => $rows["shareWith"],
"shareType" => $rows["shareType"],
"expireDate" => $rows["expireDate"],
"role" => $rows["role"]
];
$fullUrl = $this->baseUrl . $this->ocsApiUrl;
$this->featureContext->setResponse(
$this->sendPostRequestToUrl(
$fullUrl,
$user,
$this->featureContext->getPasswordForUser($user),
$body
)
);
$this->setLastShareData();
}
/**
* @Given /^user "([^"]*)" has shared the following entity "([^"]*)" inside of space "([^"]*)" with user "([^"]*)" with role "([^"]*)"$/
* @Given /^user "([^"]*)" has created a share inside of space "([^"]*)" with settings:$/
*
* @param string $user
* @param string $entity
* @param string $spaceName
* @param string $userRecipient
* @param string $role
* @param TableNode $table
*
* @return void
* @throws GuzzleException
*/
public function hasSharedTheFollowingEntityInsideOfSpace(
string $user,
string $entity,
string $spaceName,
string $userRecipient,
string $role
TableNode $table
): void {
$response = $this->sendRequestForShareOfEntityInsideOfSpace($user, $entity, $spaceName, $userRecipient, $role);
$this->createShareResource($user, $spaceName, $table);
Assert::assertEquals(
$response->getStatusCode(),
$this->featureContext->getResponse()->getStatusCode(),
200,
"Expected response status code should be 200"
);
}
/**
* @When /^user "([^"]*)" changes the last share with settings:$/
*
* @param string $user
* @param TableNode $table
*
* @return void
* @throws GuzzleException
*/
public function changeShareResource(
string $user,
TableNode $table
): void {
$shareId = $this->featureContext->getLastPublicLinkShareId();
$rows = $table->getRowsHash();
$rows["role"] = \array_key_exists("role", $rows) ? $rows["role"] : 'viewer';
$rows["expireDate"] = \array_key_exists("expireDate", $rows) ? $rows["expireDate"] : null;
$body = [
"expireDate" => $rows["expireDate"],
];
$fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId;
$this->featureContext->setResponse(
HttpRequestHelper::sendRequest(
$fullUrl,
"",
"PUT",
$this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user),
null,
$body
)
);
}
/**
* @When /^user "([^"]*)" creates a public link share inside of space "([^"]*)" with settings:$/
*
@@ -3067,20 +3087,20 @@ class SpacesContext implements Context {
$resourceType = $xmlRes->xpath("//d:response/d:propstat/d:prop/d:getcontenttype")[0]->__toString();
if ($method === 'PROPFIND') {
if (!$resourceType) {
Assert::assertEquals($this->getFolderId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
Assert::assertEquals($this->getResourceId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
} else {
Assert::assertEquals($this->getFileId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
}
} else {
if ($resourceType === 'httpd/unix-directory') {
Assert::assertEquals($this->getFolderId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
Assert::assertEquals($this->getResourceId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
} else {
Assert::assertEquals($this->getFileId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong fileId in the response');
}
}
break;
case "oc:file-parent":
Assert::assertEquals($this->getFolderId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong file-parentId in the response');
Assert::assertEquals($this->getResourceId($user, $spaceNameOrMountPoint, $value), $responseValue, 'wrong file-parentId in the response');
break;
case "oc:privatelink":
Assert::assertEquals($this->getPrivateLink($user, $spaceNameOrMountPoint), $responseValue, 'cannot find private link for space or resource in the response');

View File

@@ -84,7 +84,7 @@ class TagContext implements Context {
}
if ($fileOrFolder === 'folder') {
$resourceId = $this->spacesContext->getFolderId($user, $space, $resource);
$resourceId = $this->spacesContext->getResourceId($user, $space, $resource);
} else {
$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
}
@@ -177,7 +177,7 @@ class TagContext implements Context {
}
if ($fileOrFolder === 'folder') {
$resourceId = $this->spacesContext->getFolderId($user, $space, $resource);
$resourceId = $this->spacesContext->getResourceId($user, $space, $resource);
} else {
$resourceId = $this->spacesContext->getFileId($user, $space, $resource);
}

View File

@@ -1,757 +0,0 @@
@api @files_sharing-app-required @issue-ocis-1328 @issue-ocis-1250
Feature: a default expiration date can be specified for shares with users or groups
Background:
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares without specifying expireDate
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has created folder "/FOLDER"
When user "Alice" shares folder "/FOLDER" with user "Brian" using the sharing API
And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the HTTP status code of responses on all endpoints should be "<http_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100 | 200 |
| 2 | 200 | 200 |
Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares with expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +15 days |
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| expiration | +15 days |
| share_with | %username% |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date not enabled, user shares with expiration date set
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +15 days |
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| expiration | +15 days |
| share_with | %username% |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled but not enforced for users, user shares with expiration date and then disables
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +15 days |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When the administrator sets parameter "shareapi_default_expire_date_user_share" of app "core" to "no"
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| expiration | +15 days |
| share_with | %username% |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares with expiration date and then disables
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When the administrator sets parameter "shareapi_default_expire_date_user_share" of app "core" to "no"
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| share_with | %username% |
| expiration | +7 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +7 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares without specifying expireDate
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has shared folder "/FOLDER" with group "grp1"
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100 | 200 |
| 2 | 200 | 200 |
Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares with expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +15 days |
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| expiration | +15 days |
| share_with | grp1 |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date not enabled for groups, user shares with expiration date set
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +15 days |
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| expiration | +15 days |
| share_with | grp1 |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled but not enforced for groups, user shares with expiration date and then disables
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +15 days |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When the administrator sets parameter "shareapi_default_expire_date_group_share" of app "core" to "no"
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| share_with | grp1 |
| expiration | +15 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +15 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares with expiration date and then disables
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/FOLDER"
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +3 days |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
When the administrator sets parameter "shareapi_default_expire_date_group_share" of app "core" to "no"
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/FOLDER |
| uid_owner | %username% |
| share_with | grp1 |
| expiration | +3 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +3 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares without setting expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "/textfile0.txt" with user "Brian"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/textfile0.txt |
| uid_owner | %username% |
| share_with | %username% |
| expiration | +7 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +7 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for users, user shares with expiration date more than the default
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +10 days |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "404"
And the OCS status message should be "Cannot set expiration date more than 7 days in the future"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date is set, user shares without setting expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "/textfile0.txt" with user "Brian"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | user |
| file_target | /Shares/textfile0.txt |
| uid_owner | %username% |
| share_with | %username% |
| expiration | +30 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date set, user shares with expiration date more than the max expire date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +40 days |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "404"
And the OCS status message should be "Cannot set expiration date more than 30 days in the future"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: sharing with default expiration date enabled and enforced for users/max expire date is set, user shares and changes the max expire date greater than the previous one
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian" with permissions "read,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "40"
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled for users/max expire date is set, user shares and changes max expire date less than the previous one
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian" with permissions "read,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "15"
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares without setting expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/textfile0.txt |
| uid_owner | %username% |
| share_with | grp1 |
| expiration | +7 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +7 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares with expiration date more than the default
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +10 days |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "404"
And the OCS status message should be "Cannot set expiration date more than 7 days in the future"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: sharing with default expiration date enabled and enforced for groups/max expire date is set, user shares without setting expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1"
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| share_type | group |
| file_target | /Shares/textfile0.txt |
| uid_owner | %username% |
| share_with | grp1 |
| expiration | +30 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled and enforced for groups/max expire date set, user shares with expiration date more than the max expire date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | group |
| shareWith | grp1 |
| permissions | read,share |
| expireDate | +40 days |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "404"
And the OCS status message should be "Cannot set expiration date more than 30 days in the future"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: sharing with default expiration date enabled for groups/max expire date is set, user shares and changes the max expire date greater than the previous one
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1" with permissions "read,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When the administrator sets parameter "shareapi_expire_after_n_days_group_share" of app "core" to "40"
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | +30 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enabled for groups/max expire date is set, user shares and changes max expire date less than the previous one
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1" with permissions "read,share"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When the administrator sets parameter "shareapi_expire_after_n_days_group_share" of app "core" to "15"
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | +30 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enforced for users, user shares to a group without setting an expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has shared folder "FOLDER" with group "grp1" with permissions "read,share"
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enforced for groups, user shares to another user
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "yes"
And user "Alice" has created folder "FOLDER"
And user "Alice" has shared folder "/FOLDER" with user "Brian" with permissions "read,share"
When user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API
Then the info about the last share by user "Alice" with user "Brian" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version |
| 1 |
| 2 |
Scenario Outline: sharing with default expiration date enforced for users, user shares with invalid expiration date set
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | INVALID-DATE |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Invalid date, date format must be YYYY-MM-DD"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 404 | 200 |
| 2 | 404 | 404 |
Scenario Outline: sharing with default expiration date enforced for users, user shares with different time format
Given using OCS API version "2"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | <date> |
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "200"
And the fields of the last response to user "Alice" should include
| expiration | 2050-12-11 |
And the response when user "Brian" gets the info of the last share should include
| expiration | 2050-12-11 |
Examples:
| date |
| 2050-12-11 |
| 11-12-2050 |
| 12/11/2050 |
| 11.12.2050 |
| 11.12.2050 12:30:40 |
Scenario Outline: user shares with humanized expiration date format
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce>"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | <expiration_date> |
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the fields of the last response to user "Alice" should include
| expiration | <expiration_date> |
And the response when user "Brian" gets the info of the last share should include
| expiration | <expiration_date> |
Examples:
| ocs_api_version | expiration_date | default | enforce |
| 1 | today | yes | yes |
| 2 | today | yes | yes |
| 1 | tomorrow | yes | yes |
| 2 | tomorrow | yes | yes |
| 1 | today | yes | no |
| 2 | today | yes | no |
| 1 | tomorrow | yes | no |
| 2 | tomorrow | yes | no |
| 1 | today | no | no |
| 2 | today | no | no |
| 1 | tomorrow | no | no |
| 2 | tomorrow | no | no |
Scenario Outline: user shares with humanized expiration date format in past
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce>"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | yesterday |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Expiration date is in the past"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | ocs_status_code | http_status_code | default | enforce |
| 1 | 404 | 200 | yes | yes |
| 2 | 404 | 404 | yes | yes |
| 1 | 404 | 200 | yes | no |
| 2 | 404 | 404 | yes | no |
| 1 | 404 | 200 | no | no |
| 2 | 404 | 404 | no | no |
Scenario Outline: user shares with invalid humanized expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "<default>"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "<enforce>"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | 123 |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Invalid date, date format must be YYYY-MM-DD"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | ocs_status_code | http_status_code | default | enforce |
| 1 | 404 | 200 | yes | yes |
| 2 | 404 | 404 | yes | yes |
| 1 | 404 | 200 | yes | no |
| 2 | 404 | 404 | yes | no |
| 1 | 404 | 200 | no | no |
| 2 | 404 | 404 | no | no |
Scenario Outline: sharing with default expiration date enforced for users, user shares with past expiration date set
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" creates a share using the sharing API with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDateAsString | -10 days |
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Expiration date is in the past"
And the sharing API should report to user "Brian" that no shares are in the pending state
And user "Brian" should not have any received shares
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 404 | 200 |
| 2 | 404 | 404 |
@issue-36569
Scenario Outline: sharing with default expiration date enforced for users, max expire date is 0, user shares without specifying expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "0"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | today |
And the response when user "Brian" gets the info of the last share should include
| expiration | today |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: sharing with default expiration date enforced for users, max expire date is 1, user shares without specifying expiration date
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | tomorrow |
And the response when user "Brian" gets the info of the last share should include
| expiration | tomorrow |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

View File

@@ -49,18 +49,18 @@ Feature: public share sharers groups setting
And parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes"
And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]'
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And the fields of the last response to user "Alice" should include
| expiration | +3 days |
| expiration | 2040-01-01 22:59:59 |
Scenario: existing links can still be deleted by sharers even if they are not present in public share sharers groups
Given user "Alice" has created a public link share with settings
| path | /fileToShare.txt |
| permissions | read |
| name | shared-link |
| name | shared-link |
And parameter "public_share_sharers_groups_allowlist_enabled" of app "files_sharing" has been set to "yes"
And parameter "public_share_sharers_groups_allowlist" of app "files_sharing" has been set to '["grp1"]'
When user "Alice" deletes public link share named "shared-link" in file "fileToShare.txt" using the sharing API

View File

@@ -12,7 +12,7 @@ Feature: update a public link share
And user "Alice" has created a public link share with settings
| path | FOLDER |
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
Then the OCS status code should be "<ocs_status_code>"
And the OCS status message should be "Ok"
And the HTTP status code should be "200"
@@ -52,7 +52,7 @@ Feature: update a public link share
And user "Alice" has created a public link share with settings
| path | FOLDER |
And user "Alice" has updated the last public link share with
| expireDate | +3 days |
| expireDate | 2033-01-31T23:59:59+0100 |
When user "Alice" gets the info of the last public link share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
@@ -65,7 +65,7 @@ Feature: update a public link share
| file_target | /FOLDER |
| permissions | read |
| stime | A_NUMBER |
| expiration | +3 days |
| expiration | 2033-01-31 |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
@@ -130,13 +130,13 @@ Feature: update a public link share
| path | randomfile.txt |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download the last publicly shared file using the old public WebDAV API with password "%public%" and the content should be "Random data"
And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data"
@issue-ocis-2079
@issue-ocis-2079
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
@@ -150,14 +150,14 @@ Feature: update a public link share
| path | randomfile.txt |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
#removing password is basically making password empty
#removing password is basically making password empty
| password | %remove% |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download the last publicly shared file using the old public WebDAV API without a password and the content should be "Random data"
And the public should be able to download the last publicly shared file using the new public WebDAV API without a password and the content should be "Random data"
@issue-ocis-2079
@issue-ocis-2079
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
@@ -170,7 +170,7 @@ Feature: update a public link share
And user "Alice" has created a public link share with settings
| path | FOLDER |
And user "Alice" has updated the last public link share with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
When user "Alice" gets the info of the last public link share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
@@ -183,7 +183,7 @@ Feature: update a public link share
| file_target | /FOLDER |
| permissions | read |
| stime | A_NUMBER |
| expiration | +3 days |
| expiration | 2040-01-01 |
| token | A_TOKEN |
| storage | A_STRING |
| mail_send | 0 |
@@ -417,7 +417,7 @@ Feature: update a public link share
And uploading a file should work using the old public WebDAV API
And uploading a file should work using the new public WebDAV API
@issue-ocis-2079
@issue-ocis-2079
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
@@ -439,7 +439,7 @@ Feature: update a public link share
And the HTTP status code of responses on all endpoints should be "403"
And as "Alice" file "PARENT/CHILD/child.txt" should exist
@issue-ocis-2079 @issue-ocis-reva-292
@issue-ocis-2079 @issue-ocis-reva-292
Examples:
| ocs_api_version |
| 1 |

View File

@@ -12,7 +12,7 @@ Feature: update a public link share
And user "Alice" has created a public link share with settings
| path | FOLDER |
When user "Alice" updates the last public link share using the sharing API with
| expireDate | +3 days |
| expireDate | 2040-01-01T23:59:59+0100 |
Then the OCS status code should be "<ocs_status_code>"
And the OCS status message should be ""
#And the OCS status message should be "Ok"

View File

@@ -304,121 +304,6 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |
@issue-ocis-1328 @skipOnOcis
Scenario Outline: Forbid sharing with groups
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And parameter "shareapi_allow_group_sharing" of app "core" has been set to "no"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
@issue-ocis-1328 @skipOnOcis
Scenario Outline: Editing share permission of existing share is forbidden when sharing with groups is forbidden
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1"
And parameter "shareapi_allow_group_sharing" of app "core" has been set to "no"
When user "Alice" updates the last share using the sharing API with
| permissions | read, create |
Then the OCS status code should be "400"
And the HTTP status code should be "<http_status_code>"
And the response when user "Alice" gets the info of the last share should include
| item_type | file |
| item_source | A_STRING |
| share_type | group |
| file_target | /Shares/textfile0.txt |
| permissions | read, update, share |
| mail_send | 0 |
| uid_owner | %username% |
| displayname_owner | %displayname% |
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 400 |
@issue-ocis-1328 @skipOnOcis
Scenario Outline: Deleting group share is allowed when sharing with groups is forbidden
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with group "grp1"
And parameter "shareapi_allow_group_sharing" of app "core" has been set to "no"
When user "Alice" deletes the last share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
When user "Alice" gets the info of the last share using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And the last response should be empty
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100 | 200 |
| 2 | 200 | 404 |
@issue-ocis-1328 @skipOnOcis
Scenario Outline: user can update the role in an existing share after the system maximum expiry date has been reduced
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +30 days |
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "5"
When user "Alice" updates the last share using the sharing API with
| permissions | read |
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And the fields of the last response to user "Alice" should include
| permissions | read |
| expiration | +30 days |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@issue-ocis-1328 @skipOnOcis
Scenario Outline: user cannot concurrently update the role and date in an existing share after the system maximum expiry date has been reduced
Given using OCS API version "<ocs_api_version>"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
And user "Alice" has created a share with settings
| path | textfile0.txt |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +30 days |
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "10"
When user "Alice" updates the last share using the sharing API with
| permissions | read |
| expireDate | +28 days |
Then the OCS status message should be "Cannot set expiration date more than 10 days in the future"
And the HTTP status code should be "<http_status_code>"
And the OCS status code should be "404"
And the response when user "Alice" gets the info of the last share should include
| permissions | read, share |
| expiration | +30 days |
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: Sharer deletes file uploaded with upload-only permission by sharee to a shared folder
Given using <dav-path> DAV path