Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>

fix for issue586
This commit is contained in:
Jakob Röhrl
2018-12-18 16:32:30 +01:00
committed by Julius Härtl
parent 4eca322ca2
commit eb0cd9685d

View File

@@ -90,6 +90,14 @@ class LabelService {
throw new BadRequestException('board id must be a number'); throw new BadRequestException('board id must be a number');
} }
$boardLabels = $this->labelMapper->findAll($boardId);
foreach($boardLabels as $boardLabel) {
if ($boardLabel->getTitle() === $title) {
throw new BadRequestException('title must be unique');
break;
}
}
$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
if ($this->boardService->isArchived(null, $boardId)) { if ($this->boardService->isArchived(null, $boardId)) {
throw new StatusException('Operation not allowed. This board is archived.'); throw new StatusException('Operation not allowed. This board is archived.');