public function saveAction($id = null)
 {
     if ($this->request->isPost()) {
         // 动作集合
         $actionList = $this->request->getPost('actionList');
         $actionList = array_unique($actionList);
         // 转成字符串
         $postData = array('name' => $this->request->getPost('rightName'), 'content' => join(',', $actionList));
         if ($id) {
             $rights = Rights::findFirst($id);
             if (!$rights) {
                 $this->displayAjax(false, '未找到您要修改的信息');
             }
         } else {
             $rights = new Rights();
         }
         if ($rights->save($postData) == false) {
             $this->displayAjax(false, join($rights->getMessages(), '<br>'));
         }
         $this->displayAjax(true, '', array('redirect_url' => $this->url->get('Admin/Rights/index')));
     }
     if ($id) {
         $rights = Rights::findFirst($id);
         $this->assign('allowList', explode(',', $rights->content));
         $this->assign('data', $rights);
     }
     $this->assign('controllers', Rights::getControllers());
 }
 /**
  * 获取controller 下 action
  */
 function getActAction()
 {
     $controller = $this->request->get('controller');
     if ($controller) {
         $controllerList = Rights::getControllers();
         if (isset($controllerList[$controller])) {
             $this->displayAjax(true, '', $controllerList[$controller]);
         }
     }
     $this->displayAjax(true);
 }