feat: improve admin master data management

This commit is contained in:
taekyoungc
2026-04-08 00:19:00 +09:00
parent 89f80edc5d
commit 984ddb403e
35 changed files with 490 additions and 320 deletions

View File

@@ -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;
}