From 4c2311b9c786a240dd62cfd120ac3e4c45c92f90 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 1 Jun 2022 10:52:16 +0200 Subject: [PATCH 1/6] enable resharing check for removegrant instead addgrant Signed-off-by: jkoberg add e2e tests Signed-off-by: jkoberg expected failures Signed-off-by: jkoberg enable resharing Signed-off-by: jkoberg --- extensions/frontend/pkg/revaconfig/config.go | 2 +- extensions/graph/pkg/service/v0/drives.go | 2 +- .../expected-failures-API-on-OCIS-storage.md | 5 -- ...ected-failures-localAPI-on-OCIS-storage.md | 16 ++++ .../features/apiSpaces/resharing.feature | 84 +++++++++++++++++++ 5 files changed, 102 insertions(+), 7 deletions(-) create mode 100644 tests/acceptance/features/apiSpaces/resharing.feature diff --git a/extensions/frontend/pkg/revaconfig/config.go b/extensions/frontend/pkg/revaconfig/config.go index 87c9653bb..f9862ba13 100644 --- a/extensions/frontend/pkg/revaconfig/config.go +++ b/extensions/frontend/pkg/revaconfig/config.go @@ -159,7 +159,7 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "files_sharing": map[string]interface{}{ "api_enabled": true, - "resharing": false, + "resharing": true, "group_sharing": true, "auto_accept_share": true, "share_with_group_members_only": true, diff --git a/extensions/graph/pkg/service/v0/drives.go b/extensions/graph/pkg/service/v0/drives.go index 1880f99d8..d718933e5 100644 --- a/extensions/graph/pkg/service/v0/drives.go +++ b/extensions/graph/pkg/service/v0/drives.go @@ -498,7 +498,7 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa tmp := id identity := libregraph.IdentitySet{User: &libregraph.Identity{Id: &tmp}} switch { - case perm.AddGrant: + case perm.RemoveGrant: managerIdentities = append(managerIdentities, identity) case perm.InitiateFileUpload: editorIdentities = append(editorIdentities, identity) diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index c457e3df6..d6d809538 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -581,11 +581,6 @@ cannot share a folder with create permission - [apiShareReshareToShares2/reShareDisabled.feature:28](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares2/reShareDisabled.feature#L28) - [apiSharePublicLink3/uploadToPublicLinkShare.feature:198](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/uploadToPublicLinkShare.feature#L198) -#### [500 status code on update share](https://github.com/owncloud/ocis/issues/2011) - -- [apiShareReshareToShares3/reShareUpdate.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L152) -- [apiShareReshareToShares3/reShareUpdate.feature:153](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L153) - #### [deleting a file inside a received shared folder is moved to the trash-bin of the sharer not the receiver](https://github.com/owncloud/ocis/issues/1124) - [apiTrashbin/trashbinSharingToShares.feature:29](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinSharingToShares.feature#L29) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 6bdd1dadd..7b1c040bc 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -18,3 +18,19 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### Tries to download /Shares/ folder but it cannot be downloaded any more directly - [apiArchiver/downloadById.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L134) - [apiArchiver/downloadById.feature:135](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L135) + +#### [Resharing is now allowed for viewers and editors](https://github.com/owncloud/ocis/issues/3828) +- [apiSpaces/shareSubItemOfSpace.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L89) +- [apiSpaces/shareSubItemOfSpace.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L90) +- [apiSpaces/shareSubItemOfSpace.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L91) +- [apiSpaces/shareSubItemOfSpace.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L92) +- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L89) +- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L90) +- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L91) +- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L92) + +### Visibility of shares is still to discuss +- [apiSpaces/resharing.feature:37](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L37) +- [apiSpaces/resharing.feature:38](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L38) +- [apiSpaces/resharing.feature:39](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L39) + diff --git a/tests/acceptance/features/apiSpaces/resharing.feature b/tests/acceptance/features/apiSpaces/resharing.feature new file mode 100644 index 000000000..b90dd1e33 --- /dev/null +++ b/tests/acceptance/features/apiSpaces/resharing.feature @@ -0,0 +1,84 @@ +@api @skipOnOcV10 +Feature: Resharing + It is possible to reshare files + + Note - this feature is run in CI with ACCOUNTS_HASH_DIFFICULTY set to the default for production + See https://github.com/owncloud/ocis/issues/1542 and https://github.com/owncloud/ocis/pull/839 + + Background: + Given these users have been created with default attributes and without skeleton files: + | username | + | Alice | + | Brian | + | Carol | + | Damian | + And user "Alice" has created folder "folder" + And user "Alice" has shared folder "folder" with user "Brian" with permissions "31" + And user "Brian" accepts share "/folder" offered by user "Alice" using the sharing API + And as "Brian" folder "Shares/folder" should exist + And user "Brian" has shared folder "Shares/folder" with user "Carol" with permissions "31" + And user "Carol" accepts share "/folder" offered by user "Brian" using the sharing API + And as "Carol" folder "Shares/folder" should exist + And user "Carol" has shared folder "Shares/folder" with user "Damian" with permissions "17" + And user "Damian" accepts share "/folder" offered by user "Carol" using the sharing API + And as "Damian" folder "Shares/folder" should exist + + Scenario Outline: You should only be able to see direct incoming and outgoing shares not all the chain: + When user "" gets all the shares inside the folder "Shares/folder" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + #And user "Alice" included in the response $TODO: How to check alice is owner every time? + And the response should contain entries + And user "Brian" included in the response + And user "Carol" included in the response + And user "Damian" included in the response + Examples: + | user | numVisibleShares | BrianVisible | CarolVisible | DamianVisible | + | Brian | 2 | should be | should be | should not be | + | Carol | 2 | should not be | should be | should be | + | Damian | 1 | should not be | should not be | should be | + + Scenario: Owners can see all the chain: + When user "Alice" gets all the shares inside the folder "folder" using the sharing API + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the response should contain 3 entries + And user "Brian" should be included in the response + And user "Carol" should be included in the response + And user "Damian" should be included in the response + + Scenario: You can't share with more permissions than you have + When user "Ember" has been created with default attributes and without skeleton files + And user "Damian" shares folder "Shares/folder" with user "Ember" with permissions "31" using the sharing API + Then the OCS status code should be "404" + And the OCS status message should be "Cannot set the requested share permissions" + + Scenario Outline: Editing reshares + When user "Fred" has been created with default attributes and without skeleton files + And user "Carol" has shared folder "Shares/folder" with user "Fred" with permissions "17" + And user "Fred" accepts share "/folder" offered by user "Carol" using the sharing API + And as "Fred" folder "Shares/folder" should exist + Then user "" updates the last share using the sharing API with + | permissions | 31 | + And the OCS status code should be "" + And user "Fred" able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt" + Examples: + | user | code | canUpload | + | Alice | 100 | should be | + | Brian | 998 | should not be | + | Carol | 100 | should be | + + Scenario Outline: Deleting reshares + When user "Gina" has been created with default attributes and without skeleton files + And user "Carol" has shared folder "Shares/folder" with user "Gina" with permissions "17" + And user "Gina" accepts share "/folder" offered by user "Carol" using the sharing API + And as "Gina" folder "Shares/folder" should exist + Then user "" deletes the last share using the sharing API + And the OCS status code should be "" + And as "Gina" folder "Shares/folder" + Examples: + | user | code | exists | + | Alice | 100 | should not exist | + | Brian | 400 | should exist | + | Carol | 100 | should not exist | + From 42e51cb47c882a9f3775da355d743e53276873d4 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 1 Jun 2022 14:19:40 +0200 Subject: [PATCH 2/6] update testing update testing expected passes Signed-off-by: jkoberg update tests Signed-off-by: jkoberg update the tests Signed-off-by: jkoberg more unexpected passes Signed-off-by: jkoberg add more api tests Signed-off-by: jkoberg --- ...ected-failures-localAPI-on-OCIS-storage.md | 15 ---- ...res-webUI-on-OCIS-storage-ocisSmokeTest.md | 8 -- ...expected-failures-webUI-on-OCIS-storage.md | 71 +---------------- .../features/apiSpaces/resharing.feature | 76 ++++++++++++------- 4 files changed, 53 insertions(+), 117 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 7b1c040bc..7ce27c67f 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -19,18 +19,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiArchiver/downloadById.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L134) - [apiArchiver/downloadById.feature:135](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiArchiver/downloadById.feature#L135) -#### [Resharing is now allowed for viewers and editors](https://github.com/owncloud/ocis/issues/3828) -- [apiSpaces/shareSubItemOfSpace.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L89) -- [apiSpaces/shareSubItemOfSpace.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L90) -- [apiSpaces/shareSubItemOfSpace.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L91) -- [apiSpaces/shareSubItemOfSpace.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature#L92) -- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L89) -- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L90) -- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L91) -- [apiSpaces/shareSubItemOfSpaceViaPublicLink.feature:92](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature#L92) - -### Visibility of shares is still to discuss -- [apiSpaces/resharing.feature:37](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L37) -- [apiSpaces/resharing.feature:38](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L38) -- [apiSpaces/resharing.feature:39](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/resharing.feature#L39) - diff --git a/tests/acceptance/expected-failures-webUI-on-OCIS-storage-ocisSmokeTest.md b/tests/acceptance/expected-failures-webUI-on-OCIS-storage-ocisSmokeTest.md index fad4c38cd..a1e09b5b8 100644 --- a/tests/acceptance/expected-failures-webUI-on-OCIS-storage-ocisSmokeTest.md +++ b/tests/acceptance/expected-failures-webUI-on-OCIS-storage-ocisSmokeTest.md @@ -11,14 +11,6 @@ Other free text and Markdown formatting can be used elsewhere in the document if Only the web scenarios tagged ocisSmokeTest are run by default in OCIS CI. This file lists the expected-failures of those ocisSmokeTest scenarios. -### [enable re-sharing is not possible](https://github.com/owncloud/ocis/issues/1743) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:47](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L47) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:48](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L48) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:49](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L49) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L50) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L51) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L52) - ### [name of public link is empty and not "Public link" when not specified in the create request](https://github.com/owncloud/ocis/issues/1237) - [webUISharingPublicBasic/publicLinkCreate.feature:11](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L11) - [webUISharingPublicBasic/publicLinkCreate.feature:28](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicBasic/publicLinkCreate.feature#L28) diff --git a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md index 893b1f622..aec95cb22 100644 --- a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md @@ -42,32 +42,10 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUISharingInternalUsers/shareWithUsers.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L52) - [webUISharingInternalUsers/shareWithUsers.feature:53](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L53) - [webUISharingInternalUsers/shareWithUsers.feature:54](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L54) -- [webUISharingInternalUsers/shareWithUsers.feature:137](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L137) - [webUISharingInternalUsers/shareWithUsers.feature:275](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L275) - [webUISharingInternalUsers/shareWithUsers.feature:276](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L276) - [webUISharingInternalUsers/shareWithUsers.feature:277](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L277) -- [webUISharingInternalUsers/shareWithUsers.feature:328](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature#L328) -- [webUISharingInternalUsersCollaborator/shareWithUsers.feature:34](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersCollaborator/shareWithUsers.feature#L34) -- [webUISharingInternalUsersCollaborator/shareWithUsers.feature:35](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersCollaborator/shareWithUsers.feature#L35) -- [webUISharingInternalUsersCollaborator/shareWithUsers.feature:36](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersCollaborator/shareWithUsers.feature#L36) -- [webUISharingInternalUsersCollaborator/shareWithUsers.feature:37](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersCollaborator/shareWithUsers.feature#L37) - [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:140](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L140) -- [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:153](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L153) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:21](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L21) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:36](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L36) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L52) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:68](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L68) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:99](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L99) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:100](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L100) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:101](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L101) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:102](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L102) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:103](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L103) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:121](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L121) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:122](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L122) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:155](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L155) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:156](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L156) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:157](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L157) -- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:160](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L160) - [webUISharingPermissionsUsers/sharePermissionsUsers.feature:196](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L196) - [webUISharingPermissionsUsers/sharePermissionsUsers.feature:209](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L209) - [webUISharingPermissionsUsers/sharePermissionsUsers.feature:223](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L223) @@ -191,62 +169,20 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUISharingAcceptShares/acceptShares.feature:245](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L245) ### [Share not created with default permissions](https://github.com/owncloud/ocis/issues/1277) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L60) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:61](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L61) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:62](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L62) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:63](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L63) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:64](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L64) -- [webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature:65](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionsGroups/shareAdvancePermissionsGroup.feature#L65) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:54](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L54) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:55](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L55) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:56](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L56) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:57](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L57) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:58](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L58) -- [webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature:59](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionsGroups/sharePermissionsGroup.feature#L59) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:54](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L54) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:55](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L55) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:56](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L56) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:57](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L57) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:58](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L58) -- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:59](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L59) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:47](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L47) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:48](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L48) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:49](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L49) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L50) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L51) -- [webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionMultipleUsers/shareFileWithMultipleUsers.feature#L52) - [webUISharingInternalGroups/shareWithGroups.feature:74](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L74) - [webUISharingInternalGroups/shareWithGroups.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L72) - [webUISharingInternalGroups/shareWithGroups.feature:73](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L73) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:53](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L53) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:54](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L54) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:55](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L55) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:56](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L56) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:57](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L57) -- [webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature:58](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderAdvancedPermissionMultipleUsers/sharedFolderWithMultipleUsersAdvancedPermissions.feature#L58) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:48](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L48) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:49](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L49) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L50) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L51) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:52](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L52) -- [webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature:53](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFolderPermissionMultipleUsers/shareFolderWithMultipleUsers.feature#L53) - [webUIResharing2/reshareUsers.feature:97](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L97) - [webUIResharing2/reshareUsers.feature:98](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L98) - [webUIResharing2/reshareUsers.feature:99](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L99) - [webUIResharing2/reshareUsers.feature:132](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L132) - [webUIResharing2/reshareUsers.feature:133](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L133) - [webUIResharing2/reshareUsers.feature:134](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L134) -- [webUIResharing2/reshareUsers.feature:18](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L18) - [webUIResharing2/reshareUsers.feature:29](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L29) - [webUIResharing2/reshareUsers.feature:71](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L71) - [webUIResharing2/reshareUsers.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L72) - [webUIResharing2/reshareUsers.feature:73](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L73) -### [Different share permissions provides varying roles in oc10 and ocis](https://github.com/owncloud/ocis/issues/1277) -- [webUISharingInternalGroups/shareWithGroups.feature:166](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L166) -- [webUISharingInternalGroups/shareWithGroups.feature:180](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L180) -- [webUIResharing1/reshareUsers.feature:237](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing1/reshareUsers.feature#L237) - ### [No occ command in ocis](https://github.com/owncloud/ocis/issues/1317) ### [Expiration date set is not implemented in user share](https://github.com/owncloud/ocis/issues/1250) - [webUISharingInternalGroups/shareWithGroups.feature:277](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L277) @@ -296,9 +232,6 @@ Other free text and markdown formatting can be used elsewhere in the document if ### [Copy & Move is not supported for shares in 2.0.0-beta1](https://github.com/owncloud/ocis/issues/3721) - [webUIMoveFilesFolders/moveFiles.feature:139](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature#L139) -### [share permissions not enforced](https://github.com/owncloud/product/issues/270) -- [webUIResharing1/reshareUsers.feature:237](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing1/reshareUsers.feature#L237) - ### [Comments in sidebar](https://github.com/owncloud/web/issues/1158) - [webUIComments/comments.feature:25](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L25) - [webUIComments/comments.feature:26](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L26) @@ -466,3 +399,7 @@ Other free text and markdown formatting can be used elsewhere in the document if ### [Copy/move not possible from and into shares in oCIS](https://github.com/owncloud/web/issues/6892) - [webUIFilesCopy/copy.feature:89](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesCopy/copy.feature#L89) - [webUIFilesCopy/copy.feature:101](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesCopy/copy.feature#L101) + +### WebUI shows wrong role name +- [webUISharingPermissionsUsers/sharePermissionsUsers.feature:169](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionsUsers/sharePermissionsUsers.feature#L169) + diff --git a/tests/acceptance/features/apiSpaces/resharing.feature b/tests/acceptance/features/apiSpaces/resharing.feature index b90dd1e33..e4ff437f4 100644 --- a/tests/acceptance/features/apiSpaces/resharing.feature +++ b/tests/acceptance/features/apiSpaces/resharing.feature @@ -12,31 +12,34 @@ Feature: Resharing | Brian | | Carol | | Damian | + | Ember | + | Fred | + | Gina | And user "Alice" has created folder "folder" And user "Alice" has shared folder "folder" with user "Brian" with permissions "31" - And user "Brian" accepts share "/folder" offered by user "Alice" using the sharing API - And as "Brian" folder "Shares/folder" should exist + And user "Brian" has accepted share "/folder" offered by user "Alice" And user "Brian" has shared folder "Shares/folder" with user "Carol" with permissions "31" - And user "Carol" accepts share "/folder" offered by user "Brian" using the sharing API - And as "Carol" folder "Shares/folder" should exist + And user "Carol" has accepted share "/folder" offered by user "Brian" And user "Carol" has shared folder "Shares/folder" with user "Damian" with permissions "17" - And user "Damian" accepts share "/folder" offered by user "Carol" using the sharing API - And as "Damian" folder "Shares/folder" should exist + And user "Damian" has accepted share "/folder" offered by user "Carol" - Scenario Outline: You should only be able to see direct incoming and outgoing shares not all the chain: + Scenario Outline: You should only be able to see direct outgoing shares not all the chain: + Given user "Brian" has shared folder "Shares/folder" with user "Fred" with permissions "17" + And user "Fred" has accepted share "/folder" offered by user "Brian" When user "" gets all the shares inside the folder "Shares/folder" using the sharing API Then the OCS status code should be "100" And the HTTP status code should be "200" - #And user "Alice" included in the response $TODO: How to check alice is owner every time? And the response should contain entries - And user "Brian" included in the response + And user "Brian" should not be included in the response And user "Carol" included in the response And user "Damian" included in the response + And user "Fred" included in the response Examples: - | user | numVisibleShares | BrianVisible | CarolVisible | DamianVisible | - | Brian | 2 | should be | should be | should not be | - | Carol | 2 | should not be | should be | should be | - | Damian | 1 | should not be | should not be | should be | + | user | numVisibleShares | CarolVisible | DamianVisible | FredVisible | + | Brian | 2 | should be | should not be | should be | + | Carol | 1 | should not be | should be | should not be | + | Damian | 0 | should not be | should not be | should not be | + | Fred | 0 | should not be | should not be | should not be | Scenario: Owners can see all the chain: When user "Alice" gets all the shares inside the folder "folder" using the sharing API @@ -48,19 +51,16 @@ Feature: Resharing And user "Damian" should be included in the response Scenario: You can't share with more permissions than you have - When user "Ember" has been created with default attributes and without skeleton files - And user "Damian" shares folder "Shares/folder" with user "Ember" with permissions "31" using the sharing API + When user "Damian" shares folder "Shares/folder" with user "Ember" with permissions "31" using the sharing API Then the OCS status code should be "404" And the OCS status message should be "Cannot set the requested share permissions" Scenario Outline: Editing reshares - When user "Fred" has been created with default attributes and without skeleton files - And user "Carol" has shared folder "Shares/folder" with user "Fred" with permissions "17" - And user "Fred" accepts share "/folder" offered by user "Carol" using the sharing API - And as "Fred" folder "Shares/folder" should exist - Then user "" updates the last share using the sharing API with + Given user "Carol" has shared folder "Shares/folder" with user "Fred" with permissions "17" + And user "Fred" has accepted share "/folder" offered by user "Carol" + When user "" updates the last share using the sharing API with | permissions | 31 | - And the OCS status code should be "" + Then the OCS status code should be "" And user "Fred" able to upload file "filesForUpload/textfile.txt" to "/Shares/folder/textfile.txt" Examples: | user | code | canUpload | @@ -69,16 +69,38 @@ Feature: Resharing | Carol | 100 | should be | Scenario Outline: Deleting reshares - When user "Gina" has been created with default attributes and without skeleton files - And user "Carol" has shared folder "Shares/folder" with user "Gina" with permissions "17" - And user "Gina" accepts share "/folder" offered by user "Carol" using the sharing API - And as "Gina" folder "Shares/folder" should exist - Then user "" deletes the last share using the sharing API - And the OCS status code should be "" + Given user "Carol" has shared folder "Shares/folder" with user "Gina" with permissions "17" + And user "Gina" has accepted share "/folder" offered by user "Carol" + When user "" deletes the last share using the sharing API + Then the OCS status code should be "" And as "Gina" folder "Shares/folder" + And as "Carol" folder "Shares/folder" should exist Examples: | user | code | exists | | Alice | 100 | should not exist | | Brian | 400 | should exist | | Carol | 100 | should not exist | + Scenario Outline: Resharing with different permissions + When user "" shares folder "Shares/folder" with user "Ember" with permissions "" using the sharing API + Then the OCS status code should be "" + Examples: + | user | permissions | code | + | Brian | 17 | 100 | + | Carol | 31 | 100 | + | Damian | 17 | 100 | + | Damian | 27 | 404 | + | Damian | 31 | 404 | + + Scenario Outline: Resharing files with different permissions + Given user "Alice" has uploaded file with content "Random data" to "/file.txt" + And user "Alice" has shared file "/file.txt" with user "Brian" with permissions "" + And user "Brian" has accepted share "/file.txt" offered by user "Alice" + When user "Brian" shares file "Shares/file.txt" with user "Fred" with permissions "" using the sharing API + Then the OCS status code should be "" + Examples: + | shareepermissions | granteepermissions | code | + | 17 | 17 | 100 | + | 17 | 19 | 404 | + | 19 | 19 | 100 | + From e66c955bce59065c9ed02f205b67a491b24c0ecc Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 13 Jun 2022 13:49:35 +0200 Subject: [PATCH 3/6] update expected failures Signed-off-by: jkoberg expected failures Signed-off-by: jkoberg From a65c7cc5aa929fb124c94d63fca27ed5a6c9fae6 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 1 Jun 2022 10:54:04 +0200 Subject: [PATCH 4/6] changelog Signed-off-by: jkoberg --- changelog/unreleased/resharing.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/unreleased/resharing.md diff --git a/changelog/unreleased/resharing.md b/changelog/unreleased/resharing.md new file mode 100644 index 000000000..ee56e90e6 --- /dev/null +++ b/changelog/unreleased/resharing.md @@ -0,0 +1,5 @@ +Enhancement: Allow resharing + +This will allow resharing files + +https://github.com/owncloud/ocis/pull/3903 From 47ee2aa0a101f00df1b16c8f9b45142b7839db35 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 1 Jun 2022 10:54:19 +0200 Subject: [PATCH 5/6] bump reva version bump custom reva version Signed-off-by: jkoberg new reva Signed-off-by: jkoberg bump reva Signed-off-by: jkoberg bump reva bump reva more reva bumping Signed-off-by: jkoberg newest reva Signed-off-by: jkoberg bump reva Signed-off-by: jkoberg --- go.mod | 4 +++- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c603d50b3..e957586ec 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220512100524-551800f020d8 - github.com/cs3org/reva/v2 v2.5.2-0.20220610100041-0a37100f4bdd + github.com/cs3org/reva/v2 v2.5.2-0.20220614082505-03c87b6fe46b github.com/disintegration/imaging v1.6.2 github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 @@ -263,3 +263,5 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect stash.kopano.io/kgol/kcc-go/v5 v5.0.1 // indirect ) + +replace github.com/cs3org/go-cs3apis => github.com/kobergj/go-cs3apis v0.0.0-20220610101249-8067918fe8bf diff --git a/go.sum b/go.sum index 65cb75dbd..f47c47917 100644 --- a/go.sum +++ b/go.sum @@ -294,10 +294,8 @@ github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3p github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= -github.com/cs3org/go-cs3apis v0.0.0-20220512100524-551800f020d8 h1:31jPSD5BOjc4+h4xK1e+NFf34gtwHEexor3V7JbdcPM= -github.com/cs3org/go-cs3apis v0.0.0-20220512100524-551800f020d8/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.5.2-0.20220610100041-0a37100f4bdd h1:YT8+iFvShQkUY1QR73RB7wxGWry5FDes3DTc+SFMnHU= -github.com/cs3org/reva/v2 v2.5.2-0.20220610100041-0a37100f4bdd/go.mod h1:FG2EQ1bnRVDCX7tUL2qgPfvm9VMawxB80qoCky9diZ8= +github.com/cs3org/reva/v2 v2.5.2-0.20220614082505-03c87b6fe46b h1:8MZDpKch9klQJZYjGaabCKWJgYZ0LqHS6pGlm/jpLcM= +github.com/cs3org/reva/v2 v2.5.2-0.20220614082505-03c87b6fe46b/go.mod h1:TwD1FmU0tcnZbIzwMt01BxcEP42o220tBvGOeFPmSEg= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -799,6 +797,8 @@ github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kobergj/go-cs3apis v0.0.0-20220610101249-8067918fe8bf h1:zQRKsQOGgt5aiPs4DoosUCnY8lmKbgHY7x9lpN6aWVA= +github.com/kobergj/go-cs3apis v0.0.0-20220610101249-8067918fe8bf/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From 7d9780208755f473af9da729ff5ea99f76d947e2 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 15 Jun 2022 12:01:37 +0200 Subject: [PATCH 6/6] add comment for mapping roles Signed-off-by: jkoberg --- extensions/graph/pkg/service/v0/drives.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/graph/pkg/service/v0/drives.go b/extensions/graph/pkg/service/v0/drives.go index d718933e5..1a0d9db1f 100644 --- a/extensions/graph/pkg/service/v0/drives.go +++ b/extensions/graph/pkg/service/v0/drives.go @@ -497,11 +497,15 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa // will have the same id. tmp := id identity := libregraph.IdentitySet{User: &libregraph.Identity{Id: &tmp}} + // we need to map the permissions to the roles switch { + // having RemoveGrant qualifies you as a manager case perm.RemoveGrant: managerIdentities = append(managerIdentities, identity) + // InitiateFileUpload means you are an editor case perm.InitiateFileUpload: editorIdentities = append(editorIdentities, identity) + // Stat permission at least makes you a viewer case perm.Stat: viewerIdentities = append(viewerIdentities, identity) }