test: test for accessing same share received via user and group
This commit is contained in:
1 parent
f428a95ec0
commit
6f375eeba8
6 files changed
+372
-6
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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: ~
|
||||
@@ -359,6 +359,7 @@ default:
|
||||
- SharingNgContext:
|
||||
- OcisConfigContext:
|
||||
- SettingsContext:
|
||||
- TUSContext:
|
||||
|
||||
apiSharingNgShares:
|
||||
paths:
|
||||
|
||||
@@ -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.
|
||||
@@ -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-version> 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 |
|
||||
Reference in new issue
Block a user