diff --git a/application/admin/controller/Auth.php b/application/admin/controller/Auth.php
index d2d9dcb56..a8f3492c7 100644
--- a/application/admin/controller/Auth.php
+++ b/application/admin/controller/Auth.php
@@ -15,6 +15,7 @@
namespace app\admin\controller;
use controller\BasicAdmin;
+use library\Data;
/**
* 系统权限管理控制器
@@ -25,11 +26,72 @@ use controller\BasicAdmin;
*/
class Auth extends BasicAdmin {
+ /**
+ * 默认数据模型
+ * @var string
+ */
protected $table = 'SystemAuth';
+ /**
+ * 权限列表
+ */
public function index() {
$this->title = '系统权限管理';
parent::_list($this->table);
}
+ /**
+ * 权限授权
+ */
+ public function apply() {
+ return $this->_form($this->table, 'apply');
+ }
+
+ /**
+ * 权限添加
+ */
+ public function add() {
+ return $this->_form($this->table, 'form');
+ }
+
+ /**
+ * 权限编辑
+ */
+ public function edit() {
+ return $this->add();
+ }
+
+ /**
+ * 权限禁用
+ */
+ public function forbid() {
+ if (Data::update($this->table)) {
+ $this->success("权限禁用成功!", '');
+ } else {
+ $this->error("权限禁用失败,请稍候再试!");
+ }
+ }
+
+ /**
+ * 权限恢复
+ */
+ public function resume() {
+ if (Data::update($this->table)) {
+ $this->success("权限启用成功!", '');
+ } else {
+ $this->error("权限启用失败,请稍候再试!");
+ }
+ }
+
+ /**
+ * 权限删除
+ */
+ public function del() {
+ if (Data::update($this->table)) {
+ $this->success("权限删除成功!", '');
+ } else {
+ $this->error("权限删除失败,请稍候再试!");
+ }
+ }
+
}
diff --git a/application/admin/view/auth.index.html b/application/admin/view/auth.index.html
index 380c7bb61..82aebe9f6 100644
--- a/application/admin/view/auth.index.html
+++ b/application/admin/view/auth.index.html
@@ -47,6 +47,10 @@
|
编辑
{/if}
+ {if auth("$classuri/apply")}
+ |
+ 授权
+ {/if}
{if $vo.status eq 1 and auth("$classuri/forbid")}
|
禁用