Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests-Only] Refactor apiShareReshare3 to use Shares folder #37918

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ config = {
'apiShareReshareToRoot1',
'apiShareReshareToShares1',
'apiShareReshare2',
'apiShareReshare3',
'apiShareReshareToRoot3',
'apiShareReshareToShares3',
'apiShareUpdate',
'apiTags',
'apiTranslation',
Expand Down
16 changes: 14 additions & 2 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,21 @@ default:
- WebDavPropertiesContext:
- AppConfigurationContext:

apiShareReshare3:
apiShareReshareToRoot3:
paths:
- '%paths.base%/../features/apiShareReshare3'
- '%paths.base%/../features/apiShareReshareToRoot3'
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
- OccContext:
- PublicWebDavContext:
- TrashbinContext:
- WebDavPropertiesContext:
- AppConfigurationContext:

apiShareReshareToShares3:
paths:
- '%paths.base%/../features/apiShareReshareToShares3'
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-11 @issue-ocis-reva-243
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-243 @issue-ocis-reva-333
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: resharing a resource with an expiration date

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-11 @issue-ocis-reva-243
Feature: sharing

Background:
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And user "Alice" has been created with default attributes and skeleton files
And user "Brian" has been created with default attributes and without skeleton files
And user "Carol" has been created with default attributes and without skeleton files

Scenario Outline: Update of reshare can reduce permissions
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,create,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with user "Carol" with permissions "share,create,update,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Brian" updates the last share using the sharing API with
| permissions | share,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: Update of reshare can increase permissions to the maximum allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,create,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with user "Carol" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Brian" updates the last share using the sharing API with
| permissions | share,create,update,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: Do not allow update of reshare to exceed permissions
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with user "Carol" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Brian" updates the last share using the sharing API with
| permissions | all |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |

Scenario Outline: Update of user reshare by the original share owner can increase permissions up to the permissions of the top-level share
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,create,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with user "Carol" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Alice" updates the last share using the sharing API with
| permissions | share,create,update,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: Update of user reshare by the original share owner can increase permissions to more than the permissions of the top-level share
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with user "Carol" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Alice" updates the last share using the sharing API with
| permissions | share,create,update,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: Update of group reshare by the original share owner can increase permissions up to permissions of the top-level share
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,create,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with group "grp1" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Alice" updates the last share using the sharing API with
| permissions | share,create,update,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: Update of group reshare by the original share owner can increase permissions to more than the permissions of the top-level share
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Carol" has been added to group "grp1"
And user "Alice" has created folder "/TMP"
And user "Alice" has shared folder "/TMP" with user "Brian" with permissions "share,update,read"
And user "Brian" has accepted share "/TMP" offered by user "Alice"
And user "Brian" has shared folder "Shares/TMP" with group "grp1" with permissions "share,read"
And user "Carol" has accepted share "/TMP" offered by user "Brian"
When user "Alice" updates the last share using the sharing API with
| permissions | share,create,update,read |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile.txt"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Loading