/**
  * 追加权限
  */
 public function appendAction()
 {
     if ($this->_request->isPost()) {
         try {
             $this->rule->append($this->_request->getPost('res_name'), $this->_request->getPost('priv_name'));
             $this->_redirect($this->view->url(array('action' => 'list')));
         } catch (Exception $e) {
             $this->view->feedback(array('title' => '发生错误', 'message' => '操作失败:' . $e->getMessage()));
         }
     }
     $this->isload = false;
 }
Esempio n. 2
0
 /**
  * 追加权限
  */
 public function action_append()
 {
     if (!Auth::getInstance()->isAllow('rule.append')) {
         $this->show_message("对不起,您没有权限执行该操作");
     }
     if ($this->isPost()) {
         try {
             $this->rule->append($this->getPost('res_name'), $this->getPost('priv_name'));
             $this->request->redirect('/admin/rule/list?mod_name=' . trim($this->getQuery('mod_name')));
         } catch (Exception $e) {
             $this->show_message('操作失败:' . $e->getMessage());
         }
     }
     $this->auto_render = false;
 }