enable resharing
check for removegrant instead addgrant Signed-off-by: jkoberg <jkoberg@owncloud.com> add e2e tests Signed-off-by: jkoberg <jkoberg@owncloud.com> expected failures Signed-off-by: jkoberg <jkoberg@owncloud.com> enable resharing Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 "<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" <AliceVisible> included in the response $TODO: How to check alice is owner every time?
|
||||
And the response should contain <numVisibleShares> entries
|
||||
And user "Brian" <BrianVisible> included in the response
|
||||
And user "Carol" <CarolVisible> included in the response
|
||||
And user "Damian" <DamianVisible> 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 "<user>" updates the last share using the sharing API with
|
||||
| permissions | 31 |
|
||||
And the OCS status code should be "<code>"
|
||||
And user "Fred" <canUpload> 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 "<user>" deletes the last share using the sharing API
|
||||
And the OCS status code should be "<code>"
|
||||
And as "Gina" folder "Shares/folder" <exists>
|
||||
Examples:
|
||||
| user | code | exists |
|
||||
| Alice | 100 | should not exist |
|
||||
| Brian | 400 | should exist |
|
||||
| Carol | 100 | should not exist |
|
||||
|
||||
Reference in New Issue
Block a user