mirror of
https://github.com/Karaka-Management/oms-Script.git
synced 2026-02-15 04:28:41 +00:00
fix billing process
This commit is contained in:
parent
595b97d294
commit
510e781539
14
.github/user_bug_report.md
vendored
14
.github/user_bug_report.md
vendored
|
|
@ -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, ...]
|
|
||||||
- OS: [e.g. iOS]
|
- System: [e.g. PC or iPhone11, ...]
|
||||||
- Browser [e.g. chrome, safari]
|
- OS: [e.g. iOS]
|
||||||
- KarakaVersion [e.g. 22]
|
- Browser [e.g. chrome, safari]
|
||||||
|
- KarakaVersion [e.g. 22]
|
||||||
|
|
||||||
# Additional Information
|
# Additional Information
|
||||||
|
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ final class ApiController extends Controller
|
||||||
|
|
||||||
// is allowed to read
|
// is allowed to read
|
||||||
if (!$this->app->accountManager->get($accountId)->hasPermission(PermissionType::READ, $this->app->unitId, null, self::NAME, PermissionCategory::REPORT, $template->getId())
|
if (!$this->app->accountManager->get($accountId)->hasPermission(PermissionType::READ, $this->app->unitId, null, self::NAME, PermissionCategory::REPORT, $template->getId())
|
||||||
|| ($isExport && !$this->app->accountManager->get($accountId)->hasPermission(PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::EXPORT))
|
|| ($isExport && !$this->app->accountManager->get($accountId)->hasPermission(PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::EXPORT))
|
||||||
) {
|
) {
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ final class ApiController extends Controller
|
||||||
private function validateExport(RequestAbstract $request) : array
|
private function validateExport(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['id'] = empty($request->getData('id')))) {
|
if (($val['id'] = !$request->hasData('id'))) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -466,7 +466,7 @@ final class ApiController extends Controller
|
||||||
new AccountPermission(
|
new AccountPermission(
|
||||||
$request->header->account,
|
$request->header->account,
|
||||||
$this->app->unitId,
|
$this->app->unitId,
|
||||||
$this->app->appName,
|
$this->app->appId,
|
||||||
self::NAME,
|
self::NAME,
|
||||||
self::NAME,
|
self::NAME,
|
||||||
PermissionCategory::TEMPLATE,
|
PermissionCategory::TEMPLATE,
|
||||||
|
|
@ -494,7 +494,7 @@ final class ApiController extends Controller
|
||||||
private function validateTemplateCreate(RequestAbstract $request) : array
|
private function validateTemplateCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['name'] = empty($request->getData('name')))
|
if (($val['name'] = !$request->hasData('name'))
|
||||||
|| ($val['files'] = empty($request->getFiles()))
|
|| ($val['files'] = empty($request->getFiles()))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
|
|
@ -616,7 +616,7 @@ final class ApiController extends Controller
|
||||||
new AccountPermission(
|
new AccountPermission(
|
||||||
$request->header->account,
|
$request->header->account,
|
||||||
$this->app->unitId,
|
$this->app->unitId,
|
||||||
$this->app->appName,
|
$this->app->appId,
|
||||||
self::NAME,
|
self::NAME,
|
||||||
self::NAME,
|
self::NAME,
|
||||||
PermissionCategory::REPORT,
|
PermissionCategory::REPORT,
|
||||||
|
|
@ -644,7 +644,7 @@ final class ApiController extends Controller
|
||||||
private function validateReportCreate(RequestAbstract $request) : array
|
private function validateReportCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['template'] = empty($request->getData('template')))
|
if (($val['template'] = !$request->hasData('template'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class ControllerTest 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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user