From 1d41ecdd8fd614a05e2fc54e8dbe99f31130a372 Mon Sep 17 00:00:00 2001 From: Luka Trovic Date: Thu, 26 Feb 2026 09:47:18 +0100 Subject: [PATCH] fix: share and assign team issue fix: share and assign team issue Signed-off-by: Luka Trovic [skip ci] --- lib/Service/AssignmentService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Service/AssignmentService.php b/lib/Service/AssignmentService.php index b666e98f09..011e27e7d3 100644 --- a/lib/Service/AssignmentService.php +++ b/lib/Service/AssignmentService.php @@ -118,10 +118,14 @@ public function assignUser($cardId, $userId, int $type = Assignment::TYPE_USER) $card = $this->cardMapper->find($cardId); $boardId = $this->cardMapper->findBoardId($cardId); $boardUsers = array_keys($this->permissionService->findUsers($boardId, true)); - $groups = array_filter($this->aclMapper->findAll($boardId), function (Acl $acl) use ($userId) { + $acls = $this->aclMapper->findAll($boardId); + $groups = array_filter($acls, function (Acl $acl) use ($userId) { return $acl->getType() === Acl::PERMISSION_TYPE_GROUP && $acl->getParticipant() === $userId; }); - if (!in_array($userId, $boardUsers, true) && count($groups) !== 1) { + $teams = array_filter($acls, function (Acl $acl) use ($userId) { + return $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE && $acl->getParticipant() === $userId; + }); + if (!in_array($userId, $boardUsers, true) && count($groups) !== 1 && count($teams) !== 1) { throw new BadRequestException('The user is not part of the board'); }