示例#1
0
 /**
  * 删除一个自定义路由 & 所有该路由的权限分配
  */
 public function actionDeleteOneCustomRoute()
 {
     try {
         $id = Yii::$app->request->post(RouteModel::COL_ID);
         RouteModel::checkId($id);
         $result = PermissionModel::deleteByRouteId($id);
         if (!$result) {
             throw new JdbRbacException('Delete permission assign fail', 50015680);
         }
         $result = RouteModel::deleteOneCustomRoute($id);
         if (!$result) {
             throw new JdbRbacException();
         }
         $result = PermissionAssignModel::deleteByRouteId($id);
         return Utils::handlerForResult($result);
     } catch (JdbRbacException $e) {
         return Utils::handlerForException($e);
     }
 }