diff --git a/docs/API.md b/docs/API.md index 8e78d566c..20c3c6d67 100644 --- a/docs/API.md +++ b/docs/API.md @@ -496,10 +496,10 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit #### Request parameters -| Parameter | Type | Description | -| --------- | ------- | ---------------------------------------- | -| boardId | Integer | The id of the board the stack belongs to | -| stackId | Integer | The id of the stack | +| Parameter | Type | Description | +| --------- | ------- | ------------------------------------------------------- | +| boardId | Integer | The id of the board where the stack should be cloned to | +| stackId | Integer | The id of the stack | #### Response It will return an object of the new stack containing the new cards as well. diff --git a/lib/Service/StackService.php b/lib/Service/StackService.php index c0f630f57..71b57116d 100644 --- a/lib/Service/StackService.php +++ b/lib/Service/StackService.php @@ -398,7 +398,7 @@ class StackService { } $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); - $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_READ); + $this->permissionService->checkPermission(null, $id, Acl::PERMISSION_READ); if ($this->boardService->isArchived(null, $boardId)) { throw new StatusException('Operation not allowed. This board is archived.'); @@ -413,6 +413,9 @@ class StackService { $newStack = new Stack(); + + // TODO: Currently cloing is only possible on the same board. + // If we change this and its possible to clone to other boards the 'copy' should be removed from title $newStack->setTitle($stack->getTitle() . ' (' . $this->l10n->t('copy') . ')'); $newStack->setBoardId($boardId); $newStack->setOrder(999);