-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Shares are displayed to users with resharing rights #12105
Conversation
This is a proof of concept. missing:
|
cc @nextcloud/sharing |
The circles app needs to be upgraded to https://github.com/nextcloud/circles/tree/compat15 |
julius made some change in the UI so that there is no more possible interaction (with errors) when user have resharing rights, but is not owner. I would like to have someone with better knowledge on the sharing stuff, while we check with the new tests. @rullzer maybe ? |
foreach ($shares as $share) { | ||
try { | ||
$formatted[] = $this->formatShare($share, $path); | ||
if (!$resharingRight && $this->shareProviderResharingRights($this->currentUser, $share)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just get the node the share points to here and check if you have share permissions. Then the whole backend works for you to figure out if you have sharing rights.
I think the basis are good. However I'm not sure if the provider changes are enough. because if the file is owned by me. (So i'm the owner). Or the file is reshared by me.
Now if userA, userB, userD or userE query the endpoint they should all get the complete list of people with share access right? Only userC should not get the list. I do not think this change accomplisches this yet right? |
92a941a
to
692b892
Compare
@rullzer so I made a bunch of manual test based on your list, and it work as expected. Last work from @juliushaertl improve a lot UX.
|
However, tests needs to be checked ! |
Failing unit tests don't look related:
Edit: They are unrelated #12009 (comment) |
@daita As far as i can see, there is just a phan error really failing due to this PR.
🙈 |
9e88c56
to
5a8c066
Compare
wtf, all tests are green !? |
@nextcloud/sharing Please review this one |
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
82c0e70
to
77b95cc
Compare
Rebased to resolve conflicts. |
@juliushaertl Do you mind to also review it? |
So this will require client changes. Can you tell me exactly when a client has the rights to edit an entry? |
There is no change in the edition of an entry, we only providing more information (shares list) to people with resharing rights. Meaning, you can edit an entry when you are the owner of the share, or owner of the file. Note that the listing contains all shares and is complete: the API will send the current username of the viewer, so this should be hidden by the client. |
ok so it indeed works as adversited However we will need to extend the client to show the same info. I'm just pinging you all here so somebody reminds me/us that we need to fix that. |
LGTM merged now and fix issues we find later. |
Can you give as info, how where and what we should display? :-) |
http://localhost/nc/ocs/v2.php/apps/files_sharing/api/v1/shares?path=%2Freshare&reshares=true
How do I see that this is a reshare and current user is not allowed to edit it? |
@daita nice improvement! 👍 |
@daita there are some weird stuff going on here :)
This is supposed to be the correct behaviour, right? |
@daita yep, found the issue. server/apps/files_sharing/lib/Controller/ShareAPIController.php Lines 770 to 772 in 85a80b0
Once resharingRight we never check for shareProviderResharingRights again. @rullzer, @blizzz, @nickvergessen, @MorrisJobke I fail to really grasp how this miniFormatted variable works there, but it seems like we have a bug there. |
So in the end, after some talk, it was an issue not related to the existing code. |
All good btw, we had a late night call with Maxence and figured things out. |
Signed-off-by: Maxence Lange maxence@artificial-owl.com