diff --git a/tests/acceptance/features/apiShareManagementBasic/createShare.feature b/tests/acceptance/features/apiShareManagementBasic/createShare.feature index 43079f03d4cc..81d3d96bd740 100644 --- a/tests/acceptance/features/apiShareManagementBasic/createShare.feature +++ b/tests/acceptance/features/apiShareManagementBasic/createShare.feature @@ -1008,3 +1008,99 @@ Feature: sharing | ocs_api_version | ocs_status_code | http_status_code | | 1 | 100 | 200 | | 2 | 200 | 200 | + + Scenario Outline: sharer should not be able to share a folder to a group which he/she is not member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And group "grp2" has been created + And user "user0" has been added to group "grp1" + And user "user1" has been added to group "grp2" + When user "user0" shares folder "/PARENT" with group "grp2" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" folder "/PARENT (2)" should not exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 403 | 200 | + | 2 | 403 | 403 | + + Scenario Outline: sharer should be able to share a folder to a user who is not member of sharer group when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user0" has been added to group "grp1" + When user "user0" shares folder "/PARENT" with user "user1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" folder "/PARENT (2)" should exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 100 | 200 | + | 2 | 200 | 200 | + + Scenario Outline: sharer should be able to share a folder to a group which he/she is member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user0" has been added to group "grp1" + And user "user1" has been added to group "grp1" + When user "user0" shares folder "/PARENT" with group "grp1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" folder "/PARENT (2)" should exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 100 | 200 | + | 2 | 200 | 200 | + + Scenario Outline: sharer should not be able to share a file to a group which he/she is not member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And group "grp2" has been created + And user "user0" has been added to group "grp1" + And user "user1" has been added to group "grp2" + When user "user0" shares file "/textfile0.txt" with group "grp2" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" file "/textfile0 (2).txt" should not exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 403 | 200 | + | 2 | 403 | 403 | + + Scenario Outline: sharer should be able to share a file to a group which he/she is member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user0" has been added to group "grp1" + And user "user1" has been added to group "grp1" + When user "user0" shares folder "/textfile0.txt" with group "grp1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" file "/textfile0 (2).txt" should exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 100 | 200 | + | 2 | 200 | 200 | + + Scenario Outline: sharer should be able to share a file to a user who is not a member of sharer group when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user1" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user0" has been added to group "grp1" + When user "user0" shares folder "/textfile0.txt" with user "user1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user1" file "/textfile0 (2).txt" should exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 100 | 200 | + | 2 | 200 | 200 | diff --git a/tests/acceptance/features/apiShareReshare/reShare.feature b/tests/acceptance/features/apiShareReshare/reShare.feature index 79db5025536d..06200a156e46 100644 --- a/tests/acceptance/features/apiShareReshare/reShare.feature +++ b/tests/acceptance/features/apiShareReshare/reShare.feature @@ -448,3 +448,35 @@ Feature: sharing | ocs_api_version | ocs_status_code | | 1 | 100 | | 2 | 200 | + + Scenario Outline: User should not be able to re-share a folder to a group which he/she is not member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user2" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user2" has been added to group "grp1" + And user "user0" has shared folder "/PARENT" with user "user1" + When user "user1" shares folder "/PARENT" with group "grp1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user2" folder "/PARENT (2)" should not exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 403 | 200 | + | 2 | 403 | 403 | + + Scenario Outline: User should not be able to re-share a file to a group which he/she is not member of when share with only member group is enabled + Given using OCS API version "" + And parameter "shareapi_only_share_with_membership_groups" of app "core" has been set to "yes" + And user "user2" has been created with default attributes and skeleton files + And group "grp1" has been created + And user "user2" has been added to group "grp1" + And user "user0" has shared file "/textfile0.txt" with user "user1" + When user "user1" shares folder "/textfile0.txt" with group "grp1" using the sharing API + Then the OCS status code should be "" + And the HTTP status code should be "" + And as "user2" folder "/textfile0 (2).txt" should not exist + Examples: + | ocs_api_version | ocs_status_code | http_status_code | + | 1 | 403 | 200 | + | 2 | 403 | 403 |