diff --git a/.drone.star b/.drone.star index 1b86c2522020..0cb6851f4d87 100644 --- a/.drone.star +++ b/.drone.star @@ -106,7 +106,8 @@ config = { 'apiShareReshareToShares2', 'apiShareReshareToRoot3', 'apiShareReshareToShares3', - 'apiShareUpdate', + 'apiShareUpdateToRoot', + 'apiShareUpdateToShares', 'apiTags', 'apiTranslation', 'apiTrashbin', diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index c663bb68b507..221d3812a13a 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -337,9 +337,21 @@ default: - WebDavPropertiesContext: - AppConfigurationContext: - apiShareUpdate: + apiShareUpdateToRoot: paths: - - '%paths.base%/../features/apiShareUpdate' + - '%paths.base%/../features/apiShareUpdateToRoot' + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - OccContext: + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - AppConfigurationContext: + + apiShareUpdateToShares: + paths: + - '%paths.base%/../features/apiShareUpdateToShares' context: *common_ldap_suite_context contexts: - FeatureContext: *common_feature_context_params diff --git a/tests/acceptance/features/apiShareUpdateToRoot/updateShare.feature b/tests/acceptance/features/apiShareUpdateToRoot/updateShare.feature new file mode 100644 index 000000000000..d601521e20a8 --- /dev/null +++ b/tests/acceptance/features/apiShareUpdateToRoot/updateShare.feature @@ -0,0 +1,296 @@ +@api @files_sharing-app-required @notToImplementOnOCIS +Feature: sharing + + Background: + Given using OCS API version "1" + And user "Alice" has been created with default attributes and skeleton files + + @smokeTest + Scenario Outline: Allow modification of reshare + Given using OCS API version "" + And these users have been created with default attributes and without skeleton files: + | username | + | Brian | + | Carol | + And user "Alice" has created folder "/TMP" + And user "Alice" has shared folder "TMP" with user "Brian" + And user "Brian" has shared folder "TMP" with user "Carol" + When user "Brian" updates the last share using the sharing API with + | permissions | read | + Then the OCS status code should be "" + And user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "TMP/textfile.txt" + And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "TMP/textfile.txt" + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + Scenario Outline: keep group permissions in sync + Given using OCS API version "" + And user "Brian" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has shared file "textfile0.txt" with group "grp1" + And user "Brian" has moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt" + When user "Alice" updates the last share using the sharing API with + | permissions | read | + Then the OCS status code should be "" + And the HTTP status code should be "200" + And the fields of the last response to user "Alice" sharing with group "grp1" should include + | id | A_STRING | + | item_type | file | + | item_source | A_STRING | + | share_type | group | + | file_source | A_STRING | + | file_target | /textfile0.txt | + | permissions | read | + | stime | A_NUMBER | + | storage | A_STRING | + | mail_send | 0 | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | mimetype | text/plain | + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + Scenario Outline: Cannot set permissions to zero + Given using OCS API version "" + And group "grp1" has been created + And user "Alice" has shared folder "/FOLDER" with group "grp1" + When user "Alice" updates the last share using the sharing API with + | permissions | 0 | + Then the OCS status code should be "400" + And the HTTP status code should be "" + Examples: + | ocs_api_version | http_status_code | + | 1 | 200 | + | 2 | 400 | + + Scenario Outline: Cannot update a share of a file with a user to have only create and/or delete permission + Given using OCS API version "" + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has shared file "textfile0.txt" with user "Brian" + When user "Alice" updates the last share using the sharing API with + | permissions | | + Then the OCS status code should be "400" + And the HTTP status code should be "" + # Brian should still have at least read access to the shared file + And as "Brian" entry "textfile0.txt" should exist + Examples: + | ocs_api_version | http_status_code | permissions | + | 1 | 200 | create | + | 2 | 400 | create | + | 1 | 200 | delete | + | 2 | 400 | delete | + | 1 | 200 | create,delete | + | 2 | 400 | create,delete | + + Scenario Outline: Cannot update a share of a file with a group to have only create and/or delete permission + Given using OCS API version "" + And user "Brian" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has shared file "textfile0.txt" with group "grp1" + When user "Alice" updates the last share using the sharing API with + | permissions | | + Then the OCS status code should be "400" + And the HTTP status code should be "" + # Brian in grp1 should still have at least read access to the shared file + And as "Brian" entry "textfile0.txt" should exist + Examples: + | ocs_api_version | http_status_code | permissions | + | 1 | 200 | create | + | 2 | 400 | create | + | 1 | 200 | delete | + | 2 | 400 | delete | + | 1 | 200 | create,delete | + | 2 | 400 | create,delete | + + @skipOnFilesClassifier @issue-files-classifier-291 + Scenario: Share ownership change after moving a shared file outside of an outer share + Given these users have been created with default attributes and without skeleton files: + | username | + | Brian | + | Carol | + And user "Alice" has created folder "/folder1" + And user "Alice" has created folder "/folder1/folder2" + And user "Brian" has created folder "/moved-out" + And user "Alice" has shared folder "/folder1" with user "Brian" with permissions "all" + And user "Brian" has shared folder "/folder1/folder2" with user "Carol" with permissions "all" + When user "Brian" moves folder "/folder1/folder2" to "/moved-out/folder2" using the WebDAV API + And user "Brian" gets the info of the last share using the sharing API + Then the fields of the last response to user "Brian" sharing with user "Carol" should include + | id | A_STRING | + | item_type | folder | + | item_source | A_STRING | + | share_type | user | + | file_source | A_STRING | + | file_target | /folder2 | + | permissions | all | + | stime | A_NUMBER | + | storage | A_STRING | + | mail_send | 0 | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | mimetype | httpd/unix-directory | + And as "Alice" folder "/folder1/folder2" should not exist + And as "Carol" folder "/folder2" should exist + + Scenario: Share ownership change after moving a shared file to another share + Given these users have been created with default attributes and without skeleton files: + | username | + | Brian | + | Carol | + And user "Alice" has created folder "/Alice-folder" + And user "Alice" has created folder "/Alice-folder/folder2" + And user "Carol" has created folder "/Carol-folder" + And user "Alice" has shared folder "/Alice-folder" with user "Brian" with permissions "all" + And user "Carol" has shared folder "/Carol-folder" with user "Brian" with permissions "all" + When user "Brian" moves folder "/Alice-folder/folder2" to "/Carol-folder/folder2" using the WebDAV API + And user "Carol" gets the info of the last share using the sharing API + Then the fields of the last response to user "Carol" sharing with user "Brian" should include + | id | A_STRING | + | item_type | folder | + | item_source | A_STRING | + | share_type | user | + | file_source | A_STRING | + | file_target | /Carol-folder | + | permissions | all | + | stime | A_NUMBER | + | storage | A_STRING | + | mail_send | 0 | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | mimetype | httpd/unix-directory | + And as "Alice" folder "/Alice-folder/folder2" should not exist + And as "Carol" folder "/Carol-folder/folder2" should exist + + Scenario Outline: Increasing permissions is allowed for owner + Given using OCS API version "" + And user "Brian" has been created with default attributes and without skeleton files + And user "Carol" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Carol" has been added to group "grp1" + And user "Carol" has shared folder "/FOLDER" with group "grp1" + And user "Carol" has updated the last share with + | permissions | read | + When user "Carol" updates the last share using the sharing API with + | permissions | all | + Then the OCS status code should be "" + And the HTTP status code should be "200" + And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "FOLDER/textfile.txt" + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + Scenario Outline: Forbid sharing with groups + Given using OCS API version "" + And group "grp1" has been created + And parameter "shareapi_allow_group_sharing" of app "core" has been set to "no" + When user "Alice" shares file "/welcome.txt" with group "grp1" using the sharing API + Then the OCS status code should be "404" + And the HTTP status code should be "" + Examples: + | ocs_api_version | http_status_code | + | 1 | 200 | + | 2 | 404 | + + Scenario Outline: Editing share permission of existing share is forbidden when sharing with groups is forbidden + Given using OCS API version "" + And group "grp1" has been created + 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 "" + When user "Alice" gets the info of the last share using the sharing API + Then the fields of the last response to user "Alice" sharing with group "grp1" should include + | item_type | file | + | item_source | A_STRING | + | share_type | group | + | file_target | /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 | + + Scenario Outline: Deleting group share is allowed when sharing with groups is forbidden + Given using OCS API version "" + And group "grp1" has been created + 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 "" + And the HTTP status code should be "200" + When user "Alice" gets the info of the last share using the sharing API + Then the last response should be empty + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + 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 "" + 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 + When user "Alice" creates a share using the sharing API with settings + | path | textfile0.txt | + | shareType | user | + | shareWith | Brian | + | permissions | read,share | + | expireDate | +30 days | + Then the HTTP status code should be "200" + When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "5" + And 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 "" + When user "Alice" gets the info of the last share using the sharing API + Then 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-37217 + 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 "" + 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 created a share with settings + | path | textfile0.txt | + | shareType | user | + | shareWith | Brian | + | permissions | read,share | + | expireDate | +30 days | + When the administrator sets parameter "shareapi_expire_after_n_days_user_share" of app "core" to "10" + And user "Alice" updates the last share using the sharing API with + | permissions | read | + | expireDate | +28 | + Then the OCS status message should be "Expiration date is in the past" +# 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 "" + And the OCS status code should be "404" + When user "Alice" gets the info of the last share using the sharing API + Then the fields of the last response to user "Alice" should include + | permissions | read, share | + | expiration | +30 days | + Examples: + | ocs_api_version | http_status_code | + | 1 | 200 | + | 2 | 404 | diff --git a/tests/acceptance/features/apiShareUpdate/updateShareGroupAndUserWithSameName.feature b/tests/acceptance/features/apiShareUpdateToRoot/updateShareGroupAndUserWithSameName.feature similarity index 96% rename from tests/acceptance/features/apiShareUpdate/updateShareGroupAndUserWithSameName.feature rename to tests/acceptance/features/apiShareUpdateToRoot/updateShareGroupAndUserWithSameName.feature index 93ceab728fc9..acee69c2f9a6 100644 --- a/tests/acceptance/features/apiShareUpdate/updateShareGroupAndUserWithSameName.feature +++ b/tests/acceptance/features/apiShareUpdateToRoot/updateShareGroupAndUserWithSameName.feature @@ -1,4 +1,4 @@ -@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-194 @issue-ocis-reva-243 +@api @files_sharing-app-required @notToImplementOnOCIS Feature: updating shares to users and groups that have the same name Background: diff --git a/tests/acceptance/features/apiShareUpdate/updateShare.feature b/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature similarity index 86% rename from tests/acceptance/features/apiShareUpdate/updateShare.feature rename to tests/acceptance/features/apiShareUpdateToShares/updateShare.feature index 9cdb84cebf59..af47076ad7c4 100644 --- a/tests/acceptance/features/apiShareUpdate/updateShare.feature +++ b/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature @@ -2,7 +2,9 @@ Feature: sharing Background: - Given using OCS API version "1" + Given the administrator has set the default folder for received shares to "Shares" + And auto-accept shares has been disabled + And using OCS API version "1" And user "Alice" has been created with default attributes and skeleton files @smokeTest @toImplementOnOCIS @issue-ocis-reva-243 @@ -14,12 +16,14 @@ Feature: sharing | Carol | And user "Alice" has created folder "/TMP" And user "Alice" has shared folder "TMP" with user "Brian" - And user "Brian" has shared folder "TMP" with user "Carol" + And user "Brian" has accepted share "/TMP" offered by user "Alice" + And user "Brian" has shared folder "/Shares/TMP" with user "Carol" + And user "Carol" has accepted share "/TMP" offered by user "Brian" When user "Brian" updates the last share using the sharing API with | permissions | read | Then the OCS status code should be "" - And user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "TMP/textfile.txt" - And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "TMP/textfile.txt" + And user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "/Shares/TMP/textfile.txt" + And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "/Shares/TMP/textfile.txt" Examples: | ocs_api_version | ocs_status_code | | 1 | 100 | @@ -32,25 +36,26 @@ Feature: sharing And group "grp1" has been created And user "Brian" has been added to group "grp1" And user "Alice" has shared file "textfile0.txt" with group "grp1" - And user "Brian" has moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Brian" has moved file "/Shares/textfile0.txt" to "/FOLDER/textfile0.txt" When user "Alice" updates the last share using the sharing API with | permissions | read | Then the OCS status code should be "" And the HTTP status code should be "200" And the fields of the last response to user "Alice" sharing with group "grp1" should include - | id | A_STRING | - | item_type | file | - | item_source | A_STRING | - | share_type | group | - | file_source | A_STRING | - | file_target | /textfile0.txt | - | permissions | read | - | stime | A_NUMBER | - | storage | A_STRING | - | mail_send | 0 | - | uid_owner | %username% | - | displayname_owner | %displayname% | - | mimetype | text/plain | + | id | A_STRING | + | item_type | file | + | item_source | A_STRING | + | share_type | group | + | file_source | A_STRING | + | file_target | /Shares/textfile0.txt | + | permissions | read | + | stime | A_NUMBER | + | storage | A_STRING | + | mail_send | 0 | + | uid_owner | %username% | + | displayname_owner | %displayname% | + | mimetype | text/plain | Examples: | ocs_api_version | ocs_status_code | | 1 | 100 | @@ -75,12 +80,13 @@ Feature: sharing Given using OCS API version "" And user "Brian" has been created with default attributes and without skeleton files And user "Alice" has shared file "textfile0.txt" with user "Brian" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" When user "Alice" updates the last share using the sharing API with | permissions | | Then the OCS status code should be "400" And the HTTP status code should be "" # Brian should still have at least read access to the shared file - And as "Brian" entry "textfile0.txt" should exist + And as "Brian" entry "/Shares/textfile0.txt" should exist Examples: | ocs_api_version | http_status_code | permissions | | 1 | 200 | create | @@ -97,12 +103,13 @@ Feature: sharing And group "grp1" has been created And user "Brian" has been added to group "grp1" And user "Alice" has shared file "textfile0.txt" with group "grp1" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" When user "Alice" updates the last share using the sharing API with | permissions | | Then the OCS status code should be "400" And the HTTP status code should be "" # Brian in grp1 should still have at least read access to the shared file - And as "Brian" entry "textfile0.txt" should exist + And as "Brian" entry "/Shares/textfile0.txt" should exist Examples: | ocs_api_version | http_status_code | permissions | | 1 | 200 | create | @@ -122,8 +129,10 @@ Feature: sharing And user "Alice" has created folder "/folder1/folder2" And user "Brian" has created folder "/moved-out" And user "Alice" has shared folder "/folder1" with user "Brian" with permissions "all" - And user "Brian" has shared folder "/folder1/folder2" with user "Carol" with permissions "all" - When user "Brian" moves folder "/folder1/folder2" to "/moved-out/folder2" using the WebDAV API + And user "Brian" has accepted share "/folder1" offered by user "Alice" + And user "Brian" has shared folder "/Shares/folder1/folder2" with user "Carol" with permissions "all" + And user "Carol" has accepted share "/folder1/folder2" offered by user "Brian" + When user "Brian" moves folder "/Shares/folder1/folder2" to "/moved-out/folder2" using the WebDAV API And user "Brian" gets the info of the last share using the sharing API Then the fields of the last response to user "Brian" sharing with user "Carol" should include | id | A_STRING | @@ -131,7 +140,7 @@ Feature: sharing | item_source | A_STRING | | share_type | user | | file_source | A_STRING | - | file_target | /folder2 | + | file_target | /Shares/folder2 | | permissions | all | | stime | A_NUMBER | | storage | A_STRING | @@ -139,8 +148,8 @@ Feature: sharing | uid_owner | %username% | | displayname_owner | %displayname% | | mimetype | httpd/unix-directory | - And as "Alice" folder "/folder1/folder2" should not exist - And as "Carol" folder "/folder2" should exist + And as "Alice" folder "/Shares/folder1/folder2" should not exist + And as "Carol" folder "/Shares/folder2" should exist @toImplementOnOCIS @toFixOnOCIS @issue-ocis-reva-243 Scenario: Share ownership change after moving a shared file to another share @@ -152,8 +161,10 @@ Feature: sharing And user "Alice" has created folder "/Alice-folder/folder2" And user "Carol" has created folder "/Carol-folder" And user "Alice" has shared folder "/Alice-folder" with user "Brian" with permissions "all" + And user "Brian" has accepted share "/Alice-folder" offered by user "Alice" And user "Carol" has shared folder "/Carol-folder" with user "Brian" with permissions "all" - When user "Brian" moves folder "/Alice-folder/folder2" to "/Carol-folder/folder2" using the WebDAV API + And user "Brian" has accepted share "/Carol-folder" offered by user "Carol" + When user "Brian" moves folder "/Shares/Alice-folder/folder2" to "/Shares/Carol-folder/folder2" using the WebDAV API And user "Carol" gets the info of the last share using the sharing API Then the fields of the last response to user "Carol" sharing with user "Brian" should include | id | A_STRING | @@ -161,7 +172,7 @@ Feature: sharing | item_source | A_STRING | | share_type | user | | file_source | A_STRING | - | file_target | /Carol-folder | + | file_target | /Shares/Carol-folder | | permissions | all | | stime | A_NUMBER | | storage | A_STRING | @@ -205,7 +216,7 @@ Feature: sharing | storage_id | A_STRING | | storage | A_STRING | | file_source | A_STRING | - | file_target | /Alice-folder | + | file_target | /Shares/Alice-folder | | share_with | %username% | | share_with_displayname | %displayname% | | share_with_additional_info | | @@ -228,13 +239,14 @@ Feature: sharing And user "Brian" has been added to group "grp1" And user "Carol" has been added to group "grp1" And user "Carol" has shared folder "/FOLDER" with group "grp1" + And user "Brian" has accepted share "/FOLDER" offered by user "Carol" And user "Carol" has updated the last share with | permissions | read | When user "Carol" updates the last share using the sharing API with | permissions | all | Then the OCS status code should be "" And the HTTP status code should be "200" - And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "FOLDER/textfile.txt" + And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "/Shares/FOLDER/textfile.txt" Examples: | ocs_api_version | ocs_status_code | | 1 | 100 | @@ -268,7 +280,7 @@ Feature: sharing | item_type | file | | item_source | A_STRING | | share_type | group | - | file_target | /textfile0.txt | + | file_target | /Shares/textfile0.txt | | permissions | read, update, share | | mail_send | 0 | | uid_owner | %username% | @@ -335,6 +347,7 @@ Feature: sharing | shareWith | Brian | | permissions | read,share | | expireDate | +30 days | + 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 "10" And user "Alice" updates the last share using the sharing API with | permissions | read | diff --git a/tests/acceptance/features/apiShareUpdateToShares/updateShareGroupAndUserWithSameName.feature b/tests/acceptance/features/apiShareUpdateToShares/updateShareGroupAndUserWithSameName.feature new file mode 100644 index 000000000000..f010c95ce024 --- /dev/null +++ b/tests/acceptance/features/apiShareUpdateToShares/updateShareGroupAndUserWithSameName.feature @@ -0,0 +1,55 @@ +@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-194 @issue-ocis-reva-243 +Feature: updating shares to users and groups that have the same name + + 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 | + | Carol | + And group "Brian" has been created + And user "Carol" has been added to group "Brian" + And user "Alice" has created folder "/TMP" + And user "Alice" has uploaded file with content "Random data" to "/TMP/randomfile.txt" + + @skipOnLDAP + Scenario Outline: update permissions of a user share with a user and a group having the same name + Given using OCS API version "" + And user "Alice" has shared folder "/TMP" with group "Brian" + And user "Alice" has shared folder "/TMP" with user "Brian" + And user "Carol" has accepted share "/TMP" offered by user "Alice" + And user "Brian" has accepted share "/TMP" offered by user "Alice" + 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 "" + And the content of file "/Shares/TMP/randomfile.txt" for user "Brian" should be "Random data" + And the content of file "/Shares/TMP/randomfile.txt" for user "Carol" should be "Random data" + And user "Carol" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile-by-Carol.txt" + But user "Brian" should not be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile-by-Brian.txt" + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + @skipOnLDAP + Scenario Outline: update permissions of a group share with a user and a group having the same name + Given using OCS API version "" + And user "Alice" has shared folder "/TMP" with user "Brian" + And user "Alice" has shared folder "/TMP" with group "Brian" + And user "Carol" has accepted share "/TMP" offered by user "Alice" + And user "Brian" has accepted share "/TMP" offered by user "Alice" + 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 "" + And the content of file "/Shares/TMP/randomfile.txt" for user "Brian" should be "Random data" + And the content of file "/Shares/TMP/randomfile.txt" for user "Carol" should be "Random data" + And user "Brian" should be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile-by-Carol.txt" + But user "Carol" should not be able to upload file "filesForUpload/textfile.txt" to "Shares/TMP/textfile-by-Brian.txt" + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 |