From c14adbbdfdc7c31fd3772b437bbb8451c77c788d Mon Sep 17 00:00:00 2001 From: cxb <1151671293@qq.com> Date: Fri, 29 Nov 2019 17:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=8A=82=E7=82=B9=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=80=A7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Install/fastadmin.sql | 4 +--- application/admin/controller/Addon.php | 3 +++ application/admin/controller/auth/Rule.php | 3 +++ application/admin/lang/zh-cn.php | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 20e7aae1d..cf8e91e4b 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -219,10 +219,8 @@ INSERT INTO `fa_auth_rule` VALUES (55, 'file', 4, 'addon/index', 'View', 'fa fa- INSERT INTO `fa_auth_rule` VALUES (56, 'file', 4, 'addon/add', 'Add', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (57, 'file', 4, 'addon/edit', 'Edit', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (58, 'file', 4, 'addon/del', 'Delete', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (59, 'file', 4, 'addon/local', 'Local install', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); +INSERT INTO `fa_auth_rule` VALUES (59, 'file', 4, 'addon/downloaded', 'Local addon', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (60, 'file', 4, 'addon/state', 'Update state', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (61, 'file', 4, 'addon/install', 'Install', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); -INSERT INTO `fa_auth_rule` VALUES (62, 'file', 4, 'addon/uninstall', 'Uninstall', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (63, 'file', 4, 'addon/config', 'Setting', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (64, 'file', 4, 'addon/refresh', 'Refresh', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); INSERT INTO `fa_auth_rule` VALUES (65, 'file', 4, 'addon/multi', 'Multi', 'fa fa-circle-o', '', '', 0, 1502035509, 1502035509, 0, 'normal'); diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 4d4789b03..c9f6ba7a4 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -23,6 +23,9 @@ class Addon extends Backend public function _initialize() { parent::_initialize(); + if (!$this->auth->isSuperAdmin() && in_array($this->request->action(), ['install', 'uninstall', 'local', 'upgrade'])) { + $this->error(__('Access is allowed only to the super management group')); + } } /** diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index 321fead08..ca99f83b6 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -26,6 +26,9 @@ class Rule extends Backend public function _initialize() { parent::_initialize(); + if (!$this->auth->isSuperAdmin()){ + $this->error(__('Access is allowed only to the super management group')); + } $this->model = model('AuthRule'); // 必须将结果集转换为数组 $ruleList = collection($this->model->order('weigh', 'desc')->order('id', 'asc')->select())->toArray(); diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index bc9ca65ae..b18b5bf66 100755 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -180,4 +180,6 @@ return [ 'Admin log tips' => '管理员可以查看自己所拥有的权限的管理员日志', 'Group tips' => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员', 'Rule tips' => '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过命令行进行生成规则节点', + 'Access is allowed only to the super management group' => '仅超级管理组能访问', + 'Local addon' => '本地插件', ]; -- Gitee