diff --git a/lib/Db/Circle.php b/lib/Db/Circle.php index 6ea1e39eb..f4a4fa568 100644 --- a/lib/Db/Circle.php +++ b/lib/Db/Circle.php @@ -24,13 +24,15 @@ namespace OCA\Deck\Db; +use OCP\Share\IShare; + class Circle extends RelationalObject { /** @var \OCA\Circles\Model\Circle */ protected $object; public function __construct(\OCA\Circles\Model\Circle $circle) { - $primaryKey = $circle->getUniqueId(); + $primaryKey = IShare::TYPE_CIRCLE . ':' . $circle->getUniqueId(); parent::__construct($primaryKey, $circle); } @@ -42,4 +44,4 @@ class Circle extends RelationalObject { 'circleOwner' => $this->object->getOwner() ]; } -} \ No newline at end of file +} diff --git a/lib/Db/Group.php b/lib/Db/Group.php index f668282b7..330b592d2 100644 --- a/lib/Db/Group.php +++ b/lib/Db/Group.php @@ -24,11 +24,12 @@ namespace OCA\Deck\Db; use OCP\IGroup; +use OCP\Share\IShare; class Group extends RelationalObject { public function __construct(IGroup $group) { - $primaryKey = $group->getGID(); + $primaryKey = IShare::TYPE_GROUP . ':' . $group->getGID(); parent::__construct($primaryKey, $group); } @@ -38,4 +39,4 @@ class Group extends RelationalObject { 'displayname' => $this->object->getDisplayName() ]; } -} \ No newline at end of file +} diff --git a/lib/Db/User.php b/lib/Db/User.php index 89a386a8e..6f6d70ce0 100644 --- a/lib/Db/User.php +++ b/lib/Db/User.php @@ -24,11 +24,12 @@ namespace OCA\Deck\Db; use OCP\IUser; +use OCP\Share\IShare; class User extends RelationalObject { public function __construct(IUser $user) { - $primaryKey = $user->getUID(); + $primaryKey = IShare::TYPE_USER . ':' . $user->getUID(); parent::__construct($primaryKey, $user); } @@ -46,4 +47,4 @@ class User extends RelationalObject { public function getDisplayName() { return $this->object->getDisplayName(); } -} \ No newline at end of file +} diff --git a/lib/Service/AssignmentService.php b/lib/Service/AssignmentService.php index 418bbd9fa..0ba1071a3 100644 --- a/lib/Service/AssignmentService.php +++ b/lib/Service/AssignmentService.php @@ -126,7 +126,7 @@ class AssignmentService { $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); $assignments = $this->assignedUsersMapper->find($cardId); foreach ($assignments as $assignment) { - if ($assignment->getParticipant() === $userId) { + if ($assignment->getParticipant() === $userId && $assignment->getType() === $type) { throw new BadRequestException('The user is already assigned to the card'); } } diff --git a/src/components/board/SharingTabSidebar.vue b/src/components/board/SharingTabSidebar.vue index be1789178..7fd82d148 100644 --- a/src/components/board/SharingTabSidebar.vue +++ b/src/components/board/SharingTabSidebar.vue @@ -23,7 +23,7 @@ -