feat: improve admin master data management
This commit is contained in:
@@ -19,10 +19,10 @@ class CodeKind extends BaseController
|
||||
$this->kindModel = model(CodeKindModel::class);
|
||||
}
|
||||
|
||||
private function redirectIfCannotManageCodeMaster(): ?RedirectResponse
|
||||
private function redirectIfCannotManageCodeKindMaster(): ?RedirectResponse
|
||||
{
|
||||
if (! Roles::canManageCodeMaster((int) session()->get('mb_level'))) {
|
||||
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 관리 권한이 없습니다.');
|
||||
if (! Roles::canManageCodeKindMaster((int) session()->get('mb_level'))) {
|
||||
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류는 super admin·본부 관리자만 관리할 수 있습니다.');
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -30,7 +30,7 @@ class CodeKind extends BaseController
|
||||
|
||||
public function create()
|
||||
{
|
||||
if ($r = $this->redirectIfCannotManageCodeMaster()) {
|
||||
if ($r = $this->redirectIfCannotManageCodeKindMaster()) {
|
||||
return $r;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class CodeKind extends BaseController
|
||||
|
||||
public function store()
|
||||
{
|
||||
if ($r = $this->redirectIfCannotManageCodeMaster()) {
|
||||
if ($r = $this->redirectIfCannotManageCodeKindMaster()) {
|
||||
return $r;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class CodeKind extends BaseController
|
||||
|
||||
public function edit(int $id)
|
||||
{
|
||||
if ($r = $this->redirectIfCannotManageCodeMaster()) {
|
||||
if ($r = $this->redirectIfCannotManageCodeKindMaster()) {
|
||||
return $r;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class CodeKind extends BaseController
|
||||
|
||||
public function update(int $id)
|
||||
{
|
||||
if ($r = $this->redirectIfCannotManageCodeMaster()) {
|
||||
if ($r = $this->redirectIfCannotManageCodeKindMaster()) {
|
||||
return $r;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class CodeKind extends BaseController
|
||||
|
||||
public function delete(int $id)
|
||||
{
|
||||
if ($r = $this->redirectIfCannotManageCodeMaster()) {
|
||||
if ($r = $this->redirectIfCannotManageCodeKindMaster()) {
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user