From 8f0a6aa0b1dac1ff55403b06eb331c3df991be6f Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 16 May 2024 15:19:46 +0200 Subject: [PATCH] update 2024-05-16 15:19:46 --- src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php | 13 ++++++++++++- src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.power | 13 ++++++++++++- src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php | 5 +++-- src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power | 5 +++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php index 3c03e49..45957f9 100644 --- a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php +++ b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php @@ -39,7 +39,18 @@ class Permissions if (ArrayHelper::check($item->addpermissions)) { - $item->permissions = array_values($item->addpermissions); + if (isset($item->addpermissions["action"]) && is_array($item->addpermissions["action"]) + && isset($item->addpermissions["implementation"]) && is_array($item->addpermissions["implementation"])) + { + foreach ($item->addpermissions["action"] as $k => $action) + { + $item->permissions[] = ['action' => $action, 'implementation' => $item->addpermissions["implementation"][$k]]; + } + } + else + { + $item->permissions = array_values($item->addpermissions); + } } unset($item->addpermissions); diff --git a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.power b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.power index b1c7981..862fd4f 100644 --- a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.power +++ b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.power @@ -14,7 +14,18 @@ if (ArrayHelper::check($item->addpermissions)) { - $item->permissions = array_values($item->addpermissions); + if (isset($item->addpermissions["action"]) && is_array($item->addpermissions["action"]) + && isset($item->addpermissions["implementation"]) && is_array($item->addpermissions["implementation"])) + { + foreach ($item->addpermissions["action"] as $k => $action) + { + $item->permissions[] = ['action' => $action, 'implementation' => $item->addpermissions["implementation"][$k]]; + } + } + else + { + $item->permissions = array_values($item->addpermissions); + } } unset($item->addpermissions); diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php index 28fe043..d59a3ce 100644 --- a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php @@ -460,7 +460,7 @@ final class AccessSections } } - $this->permission ->set( + $this->permission->set( $custom_admin_view, $customAdminCode, $customAdminCode, $menuControllers, 'customAdmin' ); @@ -661,7 +661,8 @@ final class AccessSections } } } - $this->permission ->set( + + $this->permission->set( $view, $nameView, $nameViews, $menuControllers ); } diff --git a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power index 248d323..a87ff1d 100644 --- a/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power +++ b/src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power @@ -420,7 +420,7 @@ } } - $this->permission ->set( + $this->permission->set( $custom_admin_view, $customAdminCode, $customAdminCode, $menuControllers, 'customAdmin' ); @@ -621,7 +621,8 @@ } } } - $this->permission ->set( + + $this->permission->set( $view, $nameView, $nameViews, $menuControllers ); }