-
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
Fix OCS Share API path response #25003
Conversation
$node = $share->getNode(); | ||
$result['path'] = $this->rootFolder->getUserFolder($localUser)->getRelativePath($node->getPath()); | ||
$userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID()); | ||
$node = $userFolder->getById($share->getNodeId())[0]; |
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.
check for non empty result from getById
?
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.
Ah right... in case of messed up shares... yeah lets check that...
A share can only be requested by 3 'types' of people * owner * initiator * recipient So we have to get the path as the current user. Since that is the only path that has any meaning to the user.
88b5756
to
72c5535
Compare
This basically obsoletes the 'target' in the OCS SHare API response. |
Tested, works 👍 @rullzer also observed on 9.0, please backport after review |
Need seconds reviewer @ChristophWurst @nickvergessen @DeepDiver1975 @owncloud/sharing |
👍 looks good |
@rullzer please backport to 9.0 |
Backport in #25067 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #24997
There are only 3 possible types of users that can request a share via the OCS Share API:
Else they won't find the share.
This makes sure we get the share for the current user. So that the path is always something meaningfull for that user.
CC: @nickvergessen @PVince81 @icewind1991 @scriptPilot