Skip to content

Commit cf24495

Browse files
committed
ensure a team stays in sharelist when made owner,
just like with users when they transfer ownership. This means that when removing ownership, the team is still in the list of sharees. Signed-off-by: Jos Poortvliet <jospoortvliet@gmail.com>
1 parent fc8ae34 commit cf24495

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/Service/BoardService.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,19 @@ public function transferBoardOwnership(int $boardId, string $newOwner, bool $cha
646646

647647
$this->boardMapper->transferOwnership($previousOwner, $newOwner, $boardId, $newOwnerType);
648648

649+
// When transferring ownership to a circle, re-add the circle as an explicit ACL
650+
// sharee with full rights so it remains visible in the sharing sidebar.
651+
// (It was removed above to prevent a duplicate DB entry.)
652+
if ($newOwnerType === Acl::PERMISSION_TYPE_CIRCLE) {
653+
try {
654+
$this->addAcl($boardId, Acl::PERMISSION_TYPE_CIRCLE, $newOwner, true, true, true);
655+
} catch (DbException $e) {
656+
if ($e->getReason() !== DbException::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
657+
throw $e;
658+
}
659+
}
660+
}
661+
649662
// Card-content remap is only meaningful when transferring to a user, not a circle
650663
if ($changeContent && $newOwnerType === Acl::PERMISSION_TYPE_USER) {
651664
$this->assignedUsersMapper->remapAssignedUser($boardId, $previousOwner, $newOwner);

0 commit comments

Comments
 (0)