Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] ApiTests: sharing subItems inside of space #3354

Merged
merged 2 commits into from
Mar 27, 2022

Conversation

ScharfViktor
Copy link
Contributor

added tests sharing subItems inside of the space:

  • via sharing
  • via public link

Only users with the manager space role can be able to share resources within the space
Users with editor and viewer space role cannot be able to share resources within the space.
They get 404 Error with "No share permission" message. for client would certainly be better to get 403.
code here:
https://github.com/cs3org/reva/blob/9e040c93d60ec5faf6c8b0347ce9ecf8d6c6ab70/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go#L192-L196

Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally to the comments I would suggest to check if the share was created
e.g. checking if Brian can see the received share
Otherwise the server might just return "200" without doing anything and we would not notice

P.S. If you are using intelliJ Ctrl+Alt+L will format the Gherkin tables

@individual-it individual-it removed the request for review from phil-davis March 23, 2022 10:35
@ScharfViktor
Copy link
Contributor Author

Additionally to the comments I would suggest to check if the share was created e.g. checking if Brian can see the received share Otherwise the server might just return "200" without doing anything and we would not notice

I tryed to add checking from core so as not to duplicate code in ocis

When user "Brian" accepts share "<entity>" offered by user "Alice" using the sharing API
Then as "Brian" file "<entity>" should exist

but it doesn't work for me, I get Sharing::userReactsToShareOfferedBy could not find share folder, offered by Alice to Brian Failed asserting that null is not null. although share is created (I'm sure of it). @individual-it how do you think, what is wrong?

@individual-it
Copy link
Member

if Alice has shared folder/file.txt, when Brian lists his shares he only sees /file.txt. I guess that is correct because Brian does not need to know what the parent folder for Alice is

@ownclouders
Copy link
Contributor

💥 Acceptance test localApiTests-apiSpaces-ocis failed. Further test are cancelled...

@ScharfViktor ScharfViktor force-pushed the sharingSubItemInsideOfSpace branch from df0ca9c to 1fe5d0f Compare March 24, 2022 10:48
@ScharfViktor
Copy link
Contributor Author

@individual-it thanks for review. I fixed it and PR is ready

@ScharfViktor ScharfViktor merged commit 1d25f03 into master Mar 27, 2022
@delete-merged-branch delete-merged-branch bot deleted the sharingSubItemInsideOfSpace branch March 27, 2022 19:36
ownclouders pushed a commit that referenced this pull request Mar 27, 2022
Author: Viktor Scharf <[email protected]>
Date:   Sun Mar 27 21:36:13 2022 +0200

    [tests-only] ApiTests: sharing subItems inside of space (#3354)

    * add apiTests share subItem inside of space
ownclouders pushed a commit that referenced this pull request Mar 28, 2022
Author: Viktor Scharf <[email protected]>
Date:   Sun Mar 27 21:36:13 2022 +0200

    [tests-only] ApiTests: sharing subItems inside of space (#3354)

    * add apiTests share subItem inside of space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants