fix(dashboard-rbac): use normal rbac when no roles chosen (#23586)

This commit is contained in:
Ville Brofeldt
2023-04-07 09:53:35 +03:00
committed by GitHub
parent 8f0328006b
commit a8230336ff
8 changed files with 107 additions and 44 deletions

View File

@@ -23,11 +23,12 @@ from urllib import parse
import msgpack
import pyarrow as pa
import simplejson as json
from flask import g, has_request_context, request
from flask import flash, g, has_request_context, redirect, request
from flask_appbuilder.security.sqla import models as ab_models
from flask_appbuilder.security.sqla.models import User
from flask_babel import _
from sqlalchemy.orm.exc import NoResultFound
from werkzeug.wrappers.response import Response
import superset.models.core as models
from superset import app, dataframe, db, result_set, viz
@@ -592,3 +593,8 @@ def get_cta_schema_name(
if not func:
return None
return func(database, user, schema, sql)
def redirect_with_flash(url: str, message: str, category: str) -> Response:
flash(message=message, category=category)
return redirect(url)