Skip to content

Commit 9771207

Browse files
fix: share and assign team issue
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent 30d5122 commit 9771207

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Service/AssignmentService.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct(
9999
public function assignUser(int $cardId, string $userId, int $type = Assignment::TYPE_USER): Assignment {
100100
$this->assignmentServiceValidator->check(compact('cardId', 'userId'));
101101

102-
if ($type !== Assignment::TYPE_USER && $type !== Assignment::TYPE_GROUP) {
102+
if ($type !== Assignment::TYPE_USER && $type !== Assignment::TYPE_GROUP && $type !== Assignment::TYPE_CIRCLE) {
103103
throw new BadRequestException('Invalid type provided for assignemnt');
104104
}
105105

@@ -117,7 +117,10 @@ public function assignUser(int $cardId, string $userId, int $type = Assignment::
117117
$groups = array_filter($this->aclMapper->findAll($boardId), function (Acl $acl) use ($userId) {
118118
return $acl->getType() === Acl::PERMISSION_TYPE_GROUP && $acl->getParticipant() === $userId;
119119
});
120-
if (!in_array($userId, $boardUsers, true) && count($groups) !== 1) {
120+
$teams = array_filter($this->aclMapper->findAll($boardId), function (Acl $acl) use ($userId) {
121+
return $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE && $acl->getParticipant() === $userId;
122+
});
123+
if (!in_array($userId, $boardUsers, true) && count($groups) !== 1 && count($teams) !== 1) {
121124
throw new BadRequestException('The user is not part of the board');
122125
}
123126

src/components/board/SharingTabSidebar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const SOURCE_TO_SHARE_TYPE = {
9191
emails: 4,
9292
remotes: 6,
9393
teams: 7,
94+
circles: 7,
9495
}
9596
9697
export default {

0 commit comments

Comments
 (0)