Skip to content

Commit 1dcf3a1

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

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/Service/AssignmentService.php

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

51-
if ($type !== Assignment::TYPE_USER && $type !== Assignment::TYPE_GROUP && $type !== Assignment::TYPE_REMOTE) {
51+
if ($type !== Assignment::TYPE_USER && $type !== Assignment::TYPE_GROUP && $type !== Assignment::TYPE_CIRCLE) {
5252
throw new BadRequestException('Invalid type provided for assignemnt');
5353
}
5454

@@ -66,7 +66,10 @@ public function assignUser(int $cardId, string $userId, int $type = Assignment::
6666
$groups = array_filter($this->aclMapper->findAll($boardId), function (Acl $acl) use ($userId) {
6767
return $acl->getType() === Acl::PERMISSION_TYPE_GROUP && $acl->getParticipant() === $userId;
6868
});
69-
if (!in_array($userId, $boardUsers, true) && count($groups) !== 1) {
69+
$teams = array_filter($this->aclMapper->findAll($boardId), function (Acl $acl) use ($userId) {
70+
return $acl->getType() === Acl::PERMISSION_TYPE_CIRCLE && $acl->getParticipant() === $userId;
71+
});
72+
if (!in_array($userId, $boardUsers, true) && count($groups) !== 1 && count($teams) !== 1) {
7073
throw new BadRequestException('The user is not part of the board');
7174
}
7275

src/components/board/SharingTabSidebar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const SOURCE_TO_SHARE_TYPE = {
9090
groups: 1,
9191
emails: 4,
9292
remotes: 6,
93+
teams: 7,
9394
circles: 7,
9495
}
9596

0 commit comments

Comments
 (0)