fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:26 +02:00
parent 06513ba293
commit 51a7f20fbb
4 changed files with 21 additions and 15 deletions

View File

@ -8,9 +8,11 @@ assignees: ''
--- ---
# Bug Description # Bug Description
A clear and concise description of what the bug is. A clear and concise description of what the bug is.
# How to Reproduce # How to Reproduce
Steps to reproduce the behavior: Steps to reproduce the behavior:
1. Go to '...' 1. Go to '...'
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
4. See error 4. See error
# Expected Behavior # Expected Behavior
A clear and concise description of what you expected to happen. A clear and concise description of what you expected to happen.
# Screenshots # Screenshots
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
# System Information # System Information
- System: [e.g. PC or iPhone11, ...] - System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS] - OS: [e.g. iOS]
- Browser [e.g. chrome, safari] - Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22] - KarakaVersion [e.g. 22]
# Additional Information # Additional Information
Add any other context about the problem here. Add any other context about the problem here.

View File

@ -154,8 +154,8 @@ final class ApiController extends Controller
private function validateKanbanCardCreate(RequestAbstract $request) : array private function validateKanbanCardCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];
if (($val['title'] = empty($request->getData('title'))) if (($val['title'] = !$request->hasData('title'))
|| ($val['column'] = empty($request->getData('column'))) || ($val['column'] = !$request->hasData('column'))
|| ($val['status'] = ( || ($val['status'] = (
$request->hasData('status') $request->hasData('status')
&& !CardStatus::isValidValue((int) $request->getData('status')) && !CardStatus::isValidValue((int) $request->getData('status'))
@ -245,8 +245,8 @@ final class ApiController extends Controller
private function validateKanbanCardCommentCreate(RequestAbstract $request) : array private function validateKanbanCardCommentCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];
if (($val['plain'] = empty($request->getData('plain'))) if (($val['plain'] = !$request->hasData('plain'))
|| ($val['card'] = empty($request->getData('card'))) || ($val['card'] = !$request->hasData('card'))
) { ) {
return $val; return $val;
} }
@ -338,7 +338,7 @@ final class ApiController extends Controller
private function validateKanbanBoardCreate(RequestAbstract $request) : array private function validateKanbanBoardCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];
if (($val['title'] = empty($request->getData('title'))) if (($val['title'] = !$request->hasData('title'))
|| ($val['status'] = ( || ($val['status'] = (
$request->hasData('status') $request->hasData('status')
&& !CardStatus::isValidValue((int) $request->getData('status')) && !CardStatus::isValidValue((int) $request->getData('status'))
@ -454,8 +454,8 @@ final class ApiController extends Controller
private function validateKanbanColumnCreate(RequestAbstract $request) : array private function validateKanbanColumnCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];
if (($val['title'] = empty($request->getData('title')) if (($val['title'] = !$request->hasData('title')
|| ($val['board'] = empty($request->getData('board')))) || ($val['board'] = !$request->hasData('board')))
) { ) {
return $val; return $val;
} }

View File

@ -118,7 +118,7 @@ final class BackendController extends Controller
if ($board->createdBy->getId() !== $accountId if ($board->createdBy->getId() !== $accountId
&& !$this->app->accountManager->get($accountId)->hasPermission( && !$this->app->accountManager->get($accountId)->hasPermission(
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::BOARD, $board->getId()) PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::BOARD, $board->getId())
) { ) {
$view->setTemplate('/Web/Backend/Error/403_inline'); $view->setTemplate('/Web/Backend/Error/403_inline');
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
@ -183,7 +183,7 @@ final class BackendController extends Controller
$accountId = $request->header->account; $accountId = $request->header->account;
if (!$this->app->accountManager->get($accountId)->hasPermission( if (!$this->app->accountManager->get($accountId)->hasPermission(
PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::BOARD) PermissionType::CREATE, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::BOARD)
) { ) {
$view->setTemplate('/Web/Backend/Error/403_inline'); $view->setTemplate('/Web/Backend/Error/403_inline');
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;
@ -229,7 +229,7 @@ final class BackendController extends Controller
if ($card->createdBy->getId() !== $accountId if ($card->createdBy->getId() !== $accountId
&& !$this->app->accountManager->get($accountId)->hasPermission( && !$this->app->accountManager->get($accountId)->hasPermission(
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::CARD, $card->getId()) PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::CARD, $card->getId())
) { ) {
$view->setTemplate('/Web/Backend/Error/403_inline'); $view->setTemplate('/Web/Backend/Error/403_inline');
$response->header->status = RequestStatusCode::R_403; $response->header->status = RequestStatusCode::R_403;

View File

@ -68,7 +68,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$permission = new AccountPermission(); $permission = new AccountPermission();
$permission->setUnit(1); $permission->setUnit(1);
$permission->setApp('backend'); $permission->setApp(2);
$permission->setPermission( $permission->setPermission(
PermissionType::READ PermissionType::READ
| PermissionType::CREATE | PermissionType::CREATE