confirm resharing rights if viewer is current owner (#18630)

confirm resharing rights if viewer is current owner
This commit is contained in:
John Molakvoæ 2020-01-02 14:11:34 +01:00 committed by GitHub
commit a08e69a005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1462,6 +1462,10 @@ class ShareAPIController extends OCSController {
* @return bool
*/
private function hasResharingRights($viewer, $node): bool {
if ($viewer === $node->getOwner()->getUID()) {
return true;
}
foreach ([$node, $node->getParent()] as $node) {
$shares = $this->getSharesFromNode($viewer, $node, true);
foreach ($shares as $share) {