From 6d278067e81a9e25c5edf092ec66394875ac4f76 Mon Sep 17 00:00:00 2001 From: HariBhandari07 Date: Fri, 18 Sep 2020 11:27:07 +0545 Subject: [PATCH] [Tests-Only] Refactor apiShareReshare3 to use Shares folder --- .drone.star | 3 +- tests/acceptance/config/behat.yml | 16 +- .../reShareUpdate.feature | 2 +- .../reShareWithExpiryDate.feature | 2 +- .../reShareUpdate.feature | 132 ++++++ .../reShareWithExpiryDate.feature | 444 ++++++++++++++++++ 6 files changed, 594 insertions(+), 5 deletions(-) rename tests/acceptance/features/{apiShareReshare3 => apiShareReshareToRoot3}/reShareUpdate.feature (98%) rename tests/acceptance/features/{apiShareReshare3 => apiShareReshareToRoot3}/reShareWithExpiryDate.feature (99%) create mode 100644 tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature create mode 100644 tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature diff --git a/.drone.star b/.drone.star index 85f6818d45d1..ee39d0a97881 100644 --- a/.drone.star +++ b/.drone.star @@ -101,7 +101,8 @@ config = { 'apiShareReshareToRoot1', 'apiShareReshareToShares1', 'apiShareReshare2', - 'apiShareReshare3', + 'apiShareReshareToRoot3', + 'apiShareReshareToShares3', 'apiShareUpdate', 'apiTags', 'apiTranslation', diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index a37addce1ee1..f97245825603 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -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 diff --git a/tests/acceptance/features/apiShareReshare3/reShareUpdate.feature b/tests/acceptance/features/apiShareReshareToRoot3/reShareUpdate.feature similarity index 98% rename from tests/acceptance/features/apiShareReshare3/reShareUpdate.feature rename to tests/acceptance/features/apiShareReshareToRoot3/reShareUpdate.feature index 1a664c3b3b44..bc6ac6345ab4 100644 --- a/tests/acceptance/features/apiShareReshare3/reShareUpdate.feature +++ b/tests/acceptance/features/apiShareReshareToRoot3/reShareUpdate.feature @@ -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: diff --git a/tests/acceptance/features/apiShareReshare3/reShareWithExpiryDate.feature b/tests/acceptance/features/apiShareReshareToRoot3/reShareWithExpiryDate.feature similarity index 99% rename from tests/acceptance/features/apiShareReshare3/reShareWithExpiryDate.feature rename to tests/acceptance/features/apiShareReshareToRoot3/reShareWithExpiryDate.feature index 019aa87d2701..a82ef0c835a6 100644 --- a/tests/acceptance/features/apiShareReshare3/reShareWithExpiryDate.feature +++ b/tests/acceptance/features/apiShareReshareToRoot3/reShareWithExpiryDate.feature @@ -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: diff --git a/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature b/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature new file mode 100644 index 000000000000..1be8bfda0e57 --- /dev/null +++ b/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature @@ -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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 "" + 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 | diff --git a/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature b/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature new file mode 100644 index 000000000000..386aef6e4bae --- /dev/null +++ b/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature @@ -0,0 +1,444 @@ +@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-243 @issue-ocis-reva-333 +Feature: resharing a resource with an expiration date + + 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 + + @skipOnOcV10.3 + Scenario Outline: User should be able to set expiration while resharing a file with user + Given using OCS API version "" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + | expireDate | +3 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | +3 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | +3 days | + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: User should be able to set expiration while resharing a file with group + Given using OCS API version "" + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Carol" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | group | + | permissions | change | + | shareWith | grp1 | + | expireDate | +3 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | +3 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | +3 days | + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | + + @skipOnOcV10.3 + Scenario Outline: resharing with user using the sharing API with expire days set and combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +30 days | 100 | + | 2 | yes | yes | +30 days | 200 | + | 1 | no | yes | | 100 | + | 2 | no | yes | | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: resharing with group using the sharing API with expire days set and combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Carol" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | group | + | permissions | change | + | shareWith | grp1 | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +30 days | 100 | + | 2 | yes | yes | +30 days | 200 | + | 1 | no | yes | | 100 | + | 2 | no | yes | | 200 | + + @skipOnOcV10.3 + Scenario Outline: resharing with user using the sharing API without expire days set and with combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +7 days | 100 | + | 2 | yes | yes | +7 days | 200 | + | 1 | no | yes | | 100 | + | 2 | no | yes | | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: resharing with group using the sharing API without expire days set and with combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "" + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Carol" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | group | + | permissions | change | + | shareWith | grp1 | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +7 days | 100 | + | 2 | yes | yes | +7 days | 200 | + | 1 | no | yes | | 100 | + | 2 | no | yes | | 200 | + + @skipOnOcV10.3 + Scenario Outline: resharing with user using the sharing API with expire days set and with combinations of default/enforce expire date enabled and specify expire date in share + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + | expireDate | +20 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | +20 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | +20 days | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code | + | 1 | yes | yes | 100 | + | 2 | yes | yes | 200 | + | 1 | no | yes | 100 | + | 2 | no | yes | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: resharing with group using the sharing API with expire days set and with combinations of default/enforce expire date enabled and specify expire date in share + Given using OCS API version "" + And parameter "shareapi_default_expire_date_group_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_group_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_group_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And group "grp1" has been created + And user "Carol" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | group | + | permissions | change | + | shareWith | grp1 | + | expireDate | +20 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | +20 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | +20 days | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code | + | 1 | yes | yes | 100 | + | 2 | yes | yes | 200 | + | 1 | no | yes | 100 | + | 2 | no | yes | 200 | + + @skipOnOcV10.3 + Scenario Outline: Setting default expiry date and enforcement after the share is created + Given using OCS API version "" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + And user "Brian" has shared file "/Shares/textfile0.txt" with user "Carol" + And user "Carol" has accepted share "/textfile0.txt" offered by user "Brian" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "4" + When user "Brian" gets the info of the last share using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code | + | 1 | yes | yes | 100 | + | 2 | yes | yes | 200 | + | 1 | no | yes | 100 | + | 2 | no | yes | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: resharing group share with user using the sharing API with default expire date set and with combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And group "grp1" has been created + And user "Carol" has been created with default attributes and without skeleton files + And user "Brian" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with group "grp1" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +30 days | 100 | + | 2 | yes | yes | +30 days | 200 | + | 1 | no | yes | | 100 | + | 2 | no | yes | | 200 | + + @skipOnOcV10.3 @issue-ocis-reva-194 + Scenario Outline: resharing group share with user using the sharing API with default expire date set and specifying expiration on share and with combinations of default/enforce expire date enabled + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And group "grp1" has been created + And user "Carol" has been created with default attributes and without skeleton files + And user "Brian" has been added to group "grp1" + And user "Alice" has shared file "/textfile0.txt" with group "grp1" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + | expireDate | +20 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | expected-expire-date | ocs_status_code | + | 1 | yes | yes | +20 days | 100 | + | 2 | yes | yes | +20 days | 200 | + | 1 | no | yes | +20 days | 100 | + | 2 | no | yes | +20 days | 200 | + + @skipOnOcV10.3 + Scenario Outline: resharing using the sharing API with default expire date set but not enforced + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has shared file "/textfile0.txt" with user "Brian" with permissions "read,update,share" + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Brian" should include + | expiration | | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | ocs_status_code | + | 1 | yes | no | 100 | + | 2 | yes | no | 200 | + | 1 | no | no | 100 | + | 2 | no | no | 200 | + + @skipOnOcV10.3 @issue-37013 + Scenario Outline: reshare extends the received expiry date up to the default by default + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has created a share with settings + | path | textfile0.txt | + | shareType | user | + | permissions | all | + | shareWith | Brian | + | expireDate | +20 days | + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Alice" should include + | expiration | +20 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | | + Examples: + | ocs_api_version | default-expire-date | enforce-expire-date | actual-expire-date | ocs_status_code | + | 1 | yes | yes | +30 days | 100 | + | 2 | yes | yes | +30 days | 200 | + | 1 | yes | no | | 100 | + | 2 | yes | no | | 200 | + | 1 | no | no | | 100 | + | 2 | no | no | | 200 | + + @skipOnOcV10.3 @issue-37013 + Scenario Outline: reshare can extend the received expiry date further into the future + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "no" + And parameter "shareapi_expire_after_n_days_user_share" of app "core" has been set to "30" + And user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has created a share with settings + | path | textfile0.txt | + | shareType | user | + | permissions | all | + | shareWith | Brian | + | expireDate | +20 days | + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + | expireDate | +40 days | + And user "Carol" accepts share "/textfile0.txt" offered by user "Brian" using the sharing API + Then the HTTP status code should be "200" + And the OCS status code should be "" + And the information of the last share of user "Alice" should include + | expiration | +20 days | + And the response when user "Carol" gets the info of the last share should include + | expiration | +40 days | + Examples: + | ocs_api_version | default-expire-date | ocs_status_code | + | 1 | yes | 100 | + | 2 | yes | 200 | + | 1 | no | 100 | + | 2 | no | 200 | + + @skipOnOcV10.3 @issue-37013 + Scenario Outline: reshare cannot extend the received expiry date past the default when the default is enforced + Given using OCS API version "" + And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "" + 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 "Carol" has been created with default attributes and without skeleton files + And user "Alice" has created a share with settings + | path | textfile0.txt | + | shareType | user | + | permissions | all | + | shareWith | Brian | + | expireDate | +20 days | + And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" + When user "Brian" creates a share using the sharing API with settings + | path | /Shares/textfile0.txt | + | shareType | user | + | permissions | change | + | shareWith | Carol | + | expireDate | +40 days | + Then the HTTP status code should be "" + And the OCS status code should be "404" + And the information of the last share of user "Alice" should include + | expiration | +20 days | + Examples: + | ocs_api_version | default-expire-date | http_status_code | + | 1 | yes | 200 | + | 2 | yes | 404 |