Files
ocis/tests/acceptance/features/apiReshare/resharing.feature
T

120 lines
5.8 KiB
Gherkin
Raw Normal View History

2022-06-01 10:52:16 +02:00
Feature: Resharing
2023-04-21 14:59:50 +05:45
As a user
I want to reshare resources
2023-04-20 15:30:13 +05:45
So that other users can have access to them
2022-06-01 10:52:16 +02:00
Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production
See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
| Carol |
| Damian |
2022-06-01 14:19:40 +02:00
| Ember |
| Fred |
| Gina |
2022-06-01 10:52:16 +02:00
And user "Alice" has created folder "folder"
And user "Alice" has shared folder "folder" with user "Brian" with permissions "31"
And user "Brian" has shared folder "Shares/folder" with user "Carol" with permissions "31"
And user "Carol" has shared folder "Shares/folder" with user "Damian" with permissions "17"
Scenario Outline: user should only be able to see direct outgoing shares not all the chain
2022-06-01 14:19:40 +02:00
Given user "Brian" has shared folder "Shares/folder" with user "Fred" with permissions "17"
2022-06-01 10:52:16 +02:00
When user "<user>" gets all the shares inside the folder "Shares/folder" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the response should contain <numVisibleShares> entries
2022-06-01 14:19:40 +02:00
And user "Brian" should not be included in the response
2022-06-01 10:52:16 +02:00
And user "Carol" <CarolVisible> included in the response
And user "Damian" <DamianVisible> included in the response
2022-06-01 14:19:40 +02:00
And user "Fred" <FredVisible> included in the response
2022-06-01 10:52:16 +02:00
Examples:
2022-06-01 14:19:40 +02:00
| user | numVisibleShares | CarolVisible | DamianVisible | FredVisible |
| Brian | 2 | should be | should not be | should be |
| Carol | 1 | should not be | should be | should not be |
| Damian | 0 | should not be | should not be | should not be |
| Fred | 0 | should not be | should not be | should not be |
2022-06-01 10:52:16 +02:00
Scenario: owners can see all the chain
2022-06-01 10:52:16 +02:00
When user "Alice" gets all the shares inside the folder "folder" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the response should contain 3 entries
And user "Brian" should be included in the response
And user "Carol" should be included in the response
And user "Damian" should be included in the response
2023-07-31 12:47:07 +05:45
@skipOnRevaMaster
Scenario: user can't share with more permissions than they have
2022-06-01 14:19:40 +02:00
When user "Damian" shares folder "Shares/folder" with user "Ember" with permissions "31" using the sharing API
2023-07-31 12:21:47 +05:45
Then the OCS status code should be "403"
2022-06-01 10:52:16 +02:00
And the OCS status message should be "Cannot set the requested share permissions"
Scenario Outline: editing reshares
2022-06-01 14:19:40 +02:00
Given user "Carol" has shared folder "Shares/folder" with user "Fred" with permissions "17"
When user "<user>" updates the last share using the sharing API with
2022-06-01 10:52:16 +02:00
| permissions | 31 |
2022-06-01 14:19:40 +02:00
Then the OCS status code should be "<code>"
2022-06-01 10:52:16 +02:00
And user "Fred" <canUpload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
Examples:
| user | code | canUpload |
| Alice | 100 | should be |
| Brian | 998 | should not be |
| Carol | 100 | should be |
Scenario Outline: deleting reshares
2022-06-01 14:19:40 +02:00
Given user "Carol" has shared folder "Shares/folder" with user "Gina" with permissions "17"
When user "<user>" deletes the last share using the sharing API
Then the OCS status code should be "<code>"
2022-06-01 10:52:16 +02:00
And as "Gina" folder "Shares/folder" <exists>
2022-06-01 14:19:40 +02:00
And as "Carol" folder "Shares/folder" should exist
2022-06-01 10:52:16 +02:00
Examples:
| user | code | exists |
| Alice | 100 | should not exist |
2023-05-25 10:45:13 +02:00
| Brian | 998 | should exist |
2022-06-01 10:52:16 +02:00
| Carol | 100 | should not exist |
2023-07-31 12:47:07 +05:45
@skipOnRevaMaster
Scenario Outline: resharing folder with different permissions
2022-06-01 14:19:40 +02:00
When user "<user>" shares folder "Shares/folder" with user "Ember" with permissions "<permissions>" using the sharing API
Then the OCS status code should be "<code>"
Examples:
| user | permissions | code |
| Brian | 17 | 100 |
| Carol | 31 | 100 |
| Damian | 17 | 100 |
2023-07-31 12:21:47 +05:45
| Damian | 27 | 403 |
| Damian | 31 | 403 |
2022-06-01 14:19:40 +02:00
2023-07-31 12:47:07 +05:45
@skipOnRevaMaster
2023-04-21 14:59:50 +05:45
Scenario Outline: Resharing files with different permissions
2022-06-01 14:19:40 +02:00
Given user "Alice" has uploaded file with content "Random data" to "/file.txt"
And user "Alice" has shared file "/file.txt" with user "Brian" with permissions "<shareepermissions>"
When user "Brian" shares file "Shares/file.txt" with user "Fred" with permissions "<granteepermissions>" using the sharing API
Then the OCS status code should be "<code>"
Examples:
| shareepermissions | granteepermissions | code |
| 17 | 17 | 100 |
2023-07-31 12:21:47 +05:45
| 17 | 19 | 403 |
2022-06-01 14:19:40 +02:00
| 19 | 19 | 100 |
Scenario Outline: resharing with group with different permissions
Given group "security department" has been created
And the administrator has added a user "Ember" to the group "security department" using the Graph API
And the administrator has added a user "Fred" to the group "security department" using the Graph API
When user "Brian" shares folder "Shares/folder" with group "security department" with permissions "<permissions>" using the sharing API
Then the OCS status code should be "100"
And user "Ember" <canUpload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
And user "Fred" <canUpload> able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt"
Examples:
| permissions | canUpload |
| 17 | should not be |
| 31 | should be |