public function savePermissionAction() { $request = $this->getRequest(); $groupid = $this->_getSessionParam('id', ''); $model = new Sam_Model_User_Group_Right(); $db = $model->getDbTable()->getAdapter(); $db->query("DELETE FROM sys_group_rights WHERE groupid=?", array($groupid)); if ($request->getPost()) { foreach ($_POST as $key => $val) { $arKey = explode('#', $key); $resourceName = $arKey[0]; $actionName = $arKey[1]; $groupRight = new Sam_Model_User_Group_Right(); $groupRight->setGroupid($groupid)->setResource($resourceName)->setAction($actionName)->save(); } } $info = '8'; $this->_helper->redirector('permission', null, null, array('id' => $groupid, 'info' => $info)); $this->render('blank', null, true); }