Merge pull request #19936 from nextcloud/bugfix/noid/handle-unset-owner-in-sharing
Handle unset owner in sharing
This commit is contained in:
commit
0bd7382a44
|
@ -302,7 +302,7 @@ class Manager implements IManager {
|
||||||
$isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
|
$isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
|
||||||
$permissions = 0;
|
$permissions = 0;
|
||||||
$mount = $share->getNode()->getMountPoint();
|
$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
|
// When it's a reshare use the parent share permissions as maximum
|
||||||
$userMountPointId = $mount->getStorageRootId();
|
$userMountPointId = $mount->getStorageRootId();
|
||||||
$userMountPoints = $userFolder->getById($userMountPointId);
|
$userMountPoints = $userFolder->getById($userMountPointId);
|
||||||
|
@ -710,7 +710,11 @@ class Manager implements IManager {
|
||||||
}
|
}
|
||||||
$share->setShareOwner($parent->getOwner()->getUID());
|
$share->setShareOwner($parent->getOwner()->getUID());
|
||||||
} else {
|
} else {
|
||||||
|
if ($share->getNode()->getOwner()) {
|
||||||
$share->setShareOwner($share->getNode()->getOwner()->getUID());
|
$share->setShareOwner($share->getNode()->getOwner()->getUID());
|
||||||
|
} else {
|
||||||
|
$share->setShareOwner($share->getSharedBy());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Verify share type
|
//Verify share type
|
||||||
|
|
Loading…
Reference in New Issue