/** * 取消授权任务中的某条授权项目 * @throws CHttpException */ public function actionUnAssignTask($task_id, $authitems_name) { if (preg_match('/^\\d+$/', $task_id)) { models\RbacTaskItems::deleteItemsToTask($task_id, $authitems_name); } return $this->redirect(['/rbac/authitems/related-task', 'id' => $authitems_name]); }
public function actionDeleteAssignItems($id) { $model = self::findModel($id); $items = Yii::$app->request->post('authItems'); if (!is_array($items)) { throw new Exception('Invalid request.Params has Error. Please do not repeat this request again.'); } if ($items && models\RbacTaskItems::deleteItemsToTask($id, $items)) { echo '删除授权成功'; } else { throw new Exception('删除授权失败'); } }