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

Fix shares read permissions #16761

Merged
merged 7 commits into from
Oct 4, 2019
Merged

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Aug 16, 2019

We need to check if getShare (singular) also have resharing rights :)

@skjnldsv skjnldsv added this to the Nextcloud 17 milestone Aug 16, 2019
@skjnldsv skjnldsv self-assigned this Aug 16, 2019
@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch 2 times, most recently from cee92bd to ec56209 Compare August 16, 2019 14:05
@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 16, 2019
@skjnldsv

This comment has been minimized.

@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch from ec56209 to 432c411 Compare August 16, 2019 21:44
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 16, 2019
@ArtificialOwl
Copy link
Member

So, with the request to displays the list of sharing to users with resharing rights, I missed an endpoint resulting in users not being able to access information they should be allowed to read.

This PR should allow users with resharing rights to retrieve data from a specific shareId using getShare()

nice catch, @skjnldsv

@rullzer rullzer mentioned this pull request Aug 18, 2019
@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch from 432c411 to 2194a02 Compare August 19, 2019 07:51
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

CI is not happy; it seems that this gives access to a share to users that should not be able to access it.

Similarly several sharing integration tests in Talk fail too with this pull request (which of course could just mean that they need to be adjusted to the new behaviour, but it seems that they are caused by the same aforementioned problem).

@skjnldsv

This comment has been minimized.

@danxuliu

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@rullzer rullzer mentioned this pull request Aug 23, 2019
@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch from 759ef6e to 9afc6ac Compare August 27, 2019 07:46
throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
}

if ($share->getShareOwner() !== $this->currentUser && $share->getSharedBy() !== $this->currentUser) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Already part of the canEditShare

Copy link
Member Author

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

👍

@rullzer rullzer modified the milestones: Nextcloud 17, Nextcloud 18 Sep 5, 2019
@rullzer

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Oct 3, 2019
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

🐘

@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch 4 times, most recently from 717013b to 845ac7f Compare October 4, 2019 08:03
@skjnldsv
Copy link
Member Author

skjnldsv commented Oct 4, 2019

/compile amend /

@skjnldsv
Copy link
Member Author

skjnldsv commented Oct 4, 2019

Weird

modified: apps/oauth2/js/oauth2.js
12 | modified: apps/oauth2/js/oauth2.js.map
13

@skjnldsv
Copy link
Member Author

skjnldsv commented Oct 4, 2019

three acceptance failing, but when running locally:

15 scenarios (15 passed)
245 steps (245 passed)
2m53.09s (5.73Mb)

11 scenarios (11 passed)
91 steps (91 passed)
1m47.76s (5.73Mb)

12 scenarios (12 passed)
225 steps (225 passed)
2m57.98s (5.71Mb)

And the output doesn't even go to the end of test sstatus lines (like above) in drone, I guess it timed out 🤷‍♂️

@skjnldsv
Copy link
Member Author

skjnldsv commented Oct 4, 2019

Weird

modified: apps/oauth2/js/oauth2.js
12 | modified: apps/oauth2/js/oauth2.js.map
13

So, even locally or the bot cannot find changes.
@rullzer @ChristophWurst if you compile this branch locally, do you find uncommited files?

skjnldsv and others added 6 commits October 4, 2019 19:25
Copied and adjusted from "tests/integration/run-docker.sh" in Talk; see
its commit history for further reference.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This will be needed to test scenarios in which updating a share return a
different HTTP status code, like 401.

The assertion for the 200 HTTP status code was added in those scenarios
that tested updating a share (that is, those that were also checking the
OCS status code), but not in those in which updating a share was just a
preparatory step for the actual test (in the same way that the HTTP
status code is not checked in those tests when creating a share).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch from 845ac7f to b647341 Compare October 4, 2019 17:25
@skjnldsv
Copy link
Member Author

skjnldsv commented Oct 4, 2019

Okay, the acceptances issues are on master, not on this pr.
Still this weird issue on the oauth

A user with reshare permissions on a file is now able to get any share
of that file (just like the owner).

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/sharing/shares-access-sanity-checks branch from b647341 to ff895ab Compare October 4, 2019 19:40
@skjnldsv skjnldsv merged commit 2169c26 into master Oct 4, 2019
@skjnldsv skjnldsv deleted the fix/sharing/shares-access-sanity-checks branch October 4, 2019 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: sharing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants