mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 17:18:42 +00:00
fix billing process
This commit is contained in:
parent
97492570bb
commit
919db39b7a
14
.github/user_bug_report.md
vendored
14
.github/user_bug_report.md
vendored
|
|
@ -8,9 +8,11 @@ assignees: ''
|
|||
---
|
||||
|
||||
# Bug Description
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
# How to Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
|
|
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
|
|||
4. See error
|
||||
|
||||
# Expected Behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
# Screenshots
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
# System Information
|
||||
- System: [e.g. PC or iPhone11, ...]
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- KarakaVersion [e.g. 22]
|
||||
|
||||
- System: [e.g. PC or iPhone11, ...]
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- KarakaVersion [e.g. 22]
|
||||
|
||||
# Additional Information
|
||||
|
||||
Add any other context about the problem here.
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ final class ApiController extends Controller
|
|||
private function validateEditorDocTypeCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['name'] = empty($request->getData('name')))
|
||||
if (($val['name'] = !$request->hasData('name'))
|
||||
) {
|
||||
return $val;
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ final class ApiController extends Controller
|
|||
$type = new EditorDocType();
|
||||
$type->name = $request->getDataString('name') ?? '';
|
||||
|
||||
if (!empty($request->getData('title'))) {
|
||||
if ($request->hasData('title')) {
|
||||
$type->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
$request->getDataString('lang') ?? $request->getLanguage()
|
||||
|
|
@ -133,8 +133,8 @@ final class ApiController extends Controller
|
|||
private function validateEditorDocTypeL11nCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['title'] = empty($request->getData('title')))
|
||||
|| ($val['type'] = empty($request->getData('type')))
|
||||
if (($val['title'] = !$request->hasData('title'))
|
||||
|| ($val['type'] = !$request->hasData('type'))
|
||||
) {
|
||||
return $val;
|
||||
}
|
||||
|
|
@ -203,8 +203,8 @@ final class ApiController extends Controller
|
|||
private function validateEditorCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['title'] = empty($request->getData('title')))
|
||||
|| ($val['plain'] = empty($request->getData('plain')))
|
||||
if (($val['title'] = !$request->hasData('title'))
|
||||
|| ($val['plain'] = !$request->hasData('plain'))
|
||||
) {
|
||||
return $val;
|
||||
}
|
||||
|
|
@ -618,7 +618,7 @@ final class ApiController extends Controller
|
|||
private function validateEditorFileCreate(RequestAbstract $request) : array
|
||||
{
|
||||
$val = [];
|
||||
if (($val['doc'] = empty($request->getData('doc')))) {
|
||||
if (($val['doc'] = !$request->hasData('doc'))) {
|
||||
return $val;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ final class BackendController extends Controller
|
|||
|
||||
if ($doc->createdBy->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
|
|
@ -162,7 +162,7 @@ final class BackendController extends Controller
|
|||
$view->addData('tagSelector', $tagSelector);
|
||||
|
||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
);
|
||||
|
||||
return $view;
|
||||
|
|
@ -190,7 +190,7 @@ final class BackendController extends Controller
|
|||
|
||||
if ($doc->createdBy->getId() !== $accountId
|
||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::DOC, $doc->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
$permission = new AccountPermission();
|
||||
$permission->setUnit(1);
|
||||
$permission->setApp('backend');
|
||||
$permission->setApp(2);
|
||||
$permission->setPermission(
|
||||
PermissionType::READ
|
||||
| PermissionType::CREATE
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user