diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 9acdf32d380..14b78b3244e 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -1424,6 +1424,9 @@ class SpacesContext implements Context { string $destination ): void { $spaceId = $this->getSpaceIdByName($user, $spaceName); + if ($spaceName === "Shares" && !\str_starts_with($destination, "Shares/")) { + $destination = "Shares/" . \ltrim($destination, "/"); + } $response = $this->featureContext->uploadFileWithContent($user, $content, $destination, $spaceId); $this->featureContext->setResponse($response); } diff --git a/tests/acceptance/bootstrap/WebDav.php b/tests/acceptance/bootstrap/WebDav.php index 74789ff99f7..216de444756 100644 --- a/tests/acceptance/bootstrap/WebDav.php +++ b/tests/acceptance/bootstrap/WebDav.php @@ -353,6 +353,7 @@ trait WebDav { ?string $password = null, ?string $spaceId=null ): ResponseInterface { + return $this->makeDavRequest( $user, "MKCOL", @@ -2050,12 +2051,6 @@ trait WebDav { $user = $this->getActualUsername($user); $this->pauseUploadDelete(); - if (\str_starts_with($destination, "Shares/") - && $this->getDavPathVersion() === WebDavHelper::DAV_VERSION_SPACES - ) { - $spaceId = $this->spacesContext->getSpaceIdByName($user, "Shares"); - $destination = \str_replace("Shares/", "", $destination); - } $response = $this->makeDavRequest( $user, "PUT", diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml new file mode 100644 index 00000000000..1bf20b5cab8 --- /dev/null +++ b/tests/acceptance/config/behat-core.yml @@ -0,0 +1,335 @@ +default: + autoload: + "": "%paths.base%/../features/bootstrap" + suites: + coreApiMain: + paths: + - "%paths.base%/../features/coreApiMain" + context: &common_ldap_suite_context + parameters: + ldapAdminPassword: admin + ldapUsersOU: TestUsers + ldapGroupsOU: TestGroups + ldapInitialUserFilePath: /../../config/ldap-users.ldif + contexts: + - FeatureContext: &common_feature_context_params + baseUrl: http://localhost:8080 + adminUsername: admin + adminPassword: admin + regularUserPassword: 123456 + ocPath: apps/testing/api/v1/occ + - ChecksumContext: + - FilesVersionsContext: + - TrashbinContext: + - CapabilitiesContext: + - SharingNgContext: + + coreApiAuth: + paths: + - "%paths.base%/../features/coreApiAuth" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - WebDavPropertiesContext: + - AuthContext: + + coreApiCapabilities: + paths: + - "%paths.base%/../features/coreApiCapabilities" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - CapabilitiesContext: + + coreApiFavorites: + paths: + - "%paths.base%/../features/coreApiFavorites" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SpacesContext: + - FavoritesContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiShareCreateSpecialToShares1: + paths: + - "%paths.base%/../features/coreApiShareCreateSpecialToShares1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + + coreApiShareCreateSpecialToShares2: + paths: + - "%paths.base%/../features/coreApiShareCreateSpecialToShares2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + - SharingNgContext: + + coreApiSharees: + paths: + - "%paths.base%/../features/coreApiSharees" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - ShareesContext: + - OcisConfigContext: + + coreApiShareManagementToShares: + paths: + - "%paths.base%/../features/coreApiShareManagementToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SpacesContext: + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - FilesVersionsContext: + - SettingsContext: + - SharingNgContext: + + coreApiShareManagementBasicToShares: + paths: + - "%paths.base%/../features/coreApiShareManagementBasicToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - AuthContext: + - SharingNgContext: + - TUSContext: + + coreApiShareOperationsToShares1: + paths: + - "%paths.base%/../features/coreApiShareOperationsToShares1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + - SharingNgContext: + + coreApiShareOperationsToShares2: + paths: + - "%paths.base%/../features/coreApiShareOperationsToShares2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiSharePublicLink1: + paths: + - "%paths.base%/../features/coreApiSharePublicLink1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - SharingNgContext: + - WebDavPropertiesContext: + - OcisConfigContext: + + coreApiSharePublicLink2: + paths: + - "%paths.base%/../features/coreApiSharePublicLink2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - OcisConfigContext: + - SharingNgContext: + + coreApiShareUpdateToShares: + paths: + - "%paths.base%/../features/coreApiShareUpdateToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiTrashbin: + paths: + - "%paths.base%/../features/coreApiTrashbin" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiTrashbinRestore: + paths: + - "%paths.base%/../features/coreApiTrashbinRestore" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + + coreApiVersions: + paths: + - "%paths.base%/../features/coreApiVersions" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - ChecksumContext: + - FilesVersionsContext: + - WebDavPropertiesContext: + - TrashbinContext: + - SharingNgContext: + + coreApiWebdavDelete: + paths: + - "%paths.base%/../features/coreApiWebdavDelete" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - WebDavPropertiesContext: + - TrashbinContext: + + coreApiWebdavLocks: + paths: + - "%paths.base%/../features/coreApiWebdavLocks" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavLockingContext: + - WebDavPropertiesContext: + + coreApiWebdavLocks2: + paths: + - "%paths.base%/../features/coreApiWebdavLocks2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavLockingContext: + - WebDavPropertiesContext: + + coreApiWebdavMove1: + paths: + - "%paths.base%/../features/coreApiWebdavMove1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - WebDavPropertiesContext: + - TrashbinContext: + + coreApiWebdavMove2: + paths: + - "%paths.base%/../features/coreApiWebdavMove2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + - FilesVersionsContext: + - TrashbinContext: + + coreApiWebdavOperations: + paths: + - "%paths.base%/../features/coreApiWebdavOperations" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - SharingNgContext: + - WebDavPropertiesContext: + - TrashbinContext: + - OcisConfigContext: + + coreApiWebdavPreviews: + paths: + - "%paths.base%/../features/coreApiWebdavPreviews" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavProperties: + paths: + - "%paths.base%/../features/coreApiWebdavProperties" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavUpload: + paths: + - "%paths.base%/../features/coreApiWebdavUpload" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiWebdavUploadTUS: + paths: + - "%paths.base%/../features/coreApiWebdavUploadTUS" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TUSContext: + - FilesVersionsContext: + - ChecksumContext: + - SharingNgContext: + + coreApiWebdavEtagPropagation1: + paths: + - "%paths.base%/../features/coreApiWebdavEtagPropagation1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - PublicWebDavContext: + - FilesVersionsContext: + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavEtagPropagation2: + paths: + - "%paths.base%/../features/coreApiWebdavEtagPropagation2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - PublicWebDavContext: + - FilesVersionsContext: + - SharingNgContext: + - WebDavPropertiesContext: + - OcisConfigContext: + + extensions: + rdx\behatvars\BehatVariablesExtension: ~ + + Cjm\Behat\StepThroughExtension: ~ diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index b5d850e7921..03a0f2a0dc7 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -359,6 +359,7 @@ default: - SharingNgContext: - OcisConfigContext: - SettingsContext: + - TUSContext: apiSharingNgShares: paths: diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 905f76e8d76..e5c244ffb0d 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -388,5 +388,11 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSharingNgPermissions/listPermissions.feature:1550](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgPermissions/listPermissions.feature#L1550) - [apiSharingNgPermissions/listPermissions.feature:2263](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgPermissions/listPermissions.feature#L2263) +#### [Lost permission when received multiple shares on the same resource](https://github.com/owncloud/ocis/issues/8464) + +- [apiSharingNgShares/sharedWithMe.feature:5404](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature#L5404) +- [apiSharingNgShares/sharedWithMe.feature:5405](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature#L5405) +- [apiSharingNgShares/sharedWithMe.feature:5406](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature#L5406) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature b/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature index b0d0168787f..97fb71a1643 100755 --- a/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature +++ b/tests/acceptance/features/apiSharingNgShares/sharedWithMe.feature @@ -5378,3 +5378,29 @@ Feature: an user gets the resources shared to them | Editor | | Viewer | | Uploader | + + @issue-8464 + Scenario Outline: upload to a same share received from group and user share with different permissions + Given using DAV path + And group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "Folder" + And user "Alice" has sent the following resource share invitation: + | resource | Folder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Editor | + And user "Alice" has sent the following resource share invitation: + | resource | Folder | + | space | Personal | + | sharee | grp1 | + | shareType | group | + | permissionsRole | Viewer | + And user "Brian" should be able to upload file "filesForUpload/lorem.txt" to "Shares/Folder/lorem.txt" + And user "Brian" should be able to create folder "Shares/Folder/testFolder" + Examples: + | dav-path-version | + | old | + | new | + | spaces |