Skip to content
Snippets Groups Projects
Unverified Commit 35a84fe9 authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix segment/metric editor. Add comments explaining whitelisted 403 urls [ci all]

parent e66ddcdb
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ export default class PartialQueryBuilder extends Component {
query={dataset_query}
features={features}
tableMetadata={tableMetadata}
databases={tableMetadata && [tableMetadata.db]}
setQueryFn={this.setQuery}
isShowingDataReference={false}
setDatabaseFn={null}
......
......@@ -18,6 +18,18 @@ import { setErrorPage } from "metabase/redux/app";
import { Router, browserHistory } from "react-router";
import { push, syncHistoryWithStore } from 'react-router-redux'
// we shouldn't redirect these URLs because we want to handle them differently
const WHITELIST_FORBIDDEN_URLS = [
// on dashboards, we show permission errors for individual cards we don't have access to
/api\/card\/\d+\/query$/,
// metadata endpoints should not cause redirects
// we should gracefully handle cases where we don't have access to metadata
/api\/database\/\d+\/metadata$/,
/api\/database\/\d+\/fields/,
/api\/table\/\d+\/query_metadata$/,
/api\/table\/\d+\/fks$/
];
function init() {
const store = getStore(browserHistory);
const routes = getRoutes(store);
......@@ -50,14 +62,6 @@ function init() {
store.dispatch(push("/auth/login"));
});
// we shouldn't redirect these URLs because we want to handle them differently
let WHITELIST_FORBIDDEN_URLS = [
/api\/card\/\d+\/query$/,
/api\/database\/\d+\/metadata$/,
/api\/database\/\d+\/fields/,
/api\/table\/\d+\/query_metadata$/,
/api\/table\/\d+\/fks$/
];
// received a 403 response
api.on("403", (url) => {
if (url) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment