mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Handle unset owner in sharing
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
6ec7d6da7e
commit
58d5e89898
1 changed files with 6 additions and 2 deletions
|
|
@ -294,7 +294,7 @@ class Manager implements IManager {
|
|||
$isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
|
||||
$permissions = 0;
|
||||
$mount = $share->getNode()->getMountPoint();
|
||||
if (!$isFederatedShare && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
|
||||
if (!$isFederatedShare && $share->getNode()->getOwner() && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
|
||||
// When it's a reshare use the parent share permissions as maximum
|
||||
$userMountPointId = $mount->getStorageRootId();
|
||||
$userMountPoints = $userFolder->getById($userMountPointId);
|
||||
|
|
@ -632,7 +632,11 @@ class Manager implements IManager {
|
|||
}
|
||||
$share->setShareOwner($parent->getOwner()->getUID());
|
||||
} else {
|
||||
$share->setShareOwner($share->getNode()->getOwner()->getUID());
|
||||
if ($share->getNode()->getOwner()) {
|
||||
$share->setShareOwner($share->getNode()->getOwner()->getUID());
|
||||
} else {
|
||||
$share->setShareOwner($share->getSharedBy());
|
||||
}
|
||||
}
|
||||
|
||||
//Verify share type
|
||||
|
|
|
|||
Loading…
Reference in a new issue