-
Notifications
You must be signed in to change notification settings - Fork 2.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
Check that the owner of a link share still has share permissions on access #20928
Conversation
By analyzing the blame information on this pull request, we identified @LukasReschke, @DeepDiver1975 and @owncloud-bot to be potential reviewers |
That's only half the fix, we should also prevent the web UI page to show |
AFAIK it already has a check when link sharing is completely disabled. Maybe just add an additional condition there ? |
Yes, I'm aware
That place doesn't have an easy way to access the fileinfo/permissions |
Never mind, I tested the wrong thing... This is only public dav |
I can say that it works, because the web UI is using public webdav and am now getting an error 👍 The next step will be to make the share link page show a 404. |
|
||
public function beforeMethod(RequestInterface $request, ResponseInterface $response){ | ||
// verify that the owner didn't have his share permissions revoked | ||
if (!$this->fileInfo->isShareable()) { |
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.
Instead of a new plugin, how about adding the check in PublicAuth
? Or put it in the code that resolves the share ? (which would cover both Webdav and web UI)
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.
The problem is that we need access to the fileinfo which we dont have in the publicauth or share code
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.
How about just adding this if block directly inline then here https://github.com/owncloud/core/pull/20928/files#diff-c176f230a2fba97e6f6e1af689b09e6aR73 ?
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.
Can't do that since this check only needs to be done for public stuff
f3254e3
to
92b02b8
Compare
Tested with #20903
|
92b02b8
to
70a01b0
Compare
@icewind1991 any update ? Can this be done before the freeze ? Are you having difficulties making this work ? |
70a01b0
to
94c3dc3
Compare
@PVince81 all fixed @DeepDiver1975 @MorrisJobke @rullzer please review |
Tested, works now 👍 |
Code looks good... what about unit tests? |
existing tests seems to fail as well:
|
Fixed the unit test.. the node needed more to be mocked... Sometimes I think I should mock less... |
Added test |
d234fe1
to
acd8c72
Compare
looks good now... 👍 if all tests passed |
Check that the owner of a link share still has share permissions on access
Part of #19157 (comment)
Easiest way to check atm is to manually edit the permissions in the database for a publicly shared file
cc @PVince81 @DeepDiver1975