Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
2c7d0cf1
Unverified
Commit
2c7d0cf1
authored
8 months ago
by
John Swanson
Committed by
GitHub
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Preprocess queries before data perms check (#45601)" (#46429)
This reverts commit
c7a5aee1
.
parent
00223821
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/models/query/permissions.clj
+2
-11
2 additions, 11 deletions
src/metabase/models/query/permissions.clj
with
2 additions
and
11 deletions
src/metabase/models/query/permissions.clj
+
2
−
11
View file @
2c7d0cf1
...
...
@@ -133,9 +133,7 @@
(
try
(
let
[
query
(
mbql.normalize/normalize
query
)]
;; if we are using a Card as our source, our perms are that Card's (i.e. that Card's Collection's) read perms
(
if-let
[
source-card-id
(
if
already-preprocessed?
(
:qp/source-card-id
query
)
(
qp.util/query->source-card-id
query
))]
(
if-let
[
source-card-id
(
qp.util/query->source-card-id
query
)]
{
:paths
(
source-card-read-perms
source-card-id
)}
;; otherwise if there's no source card then calculate perms based on the Tables referenced in the query
(
let
[
query
(
cond->
query
...
...
@@ -265,14 +263,7 @@
(
mu/defn
can-run-query?
"Return `true` if the current user has sufficient permissions to run `query`, and `false` otherwise."
[
query
]
(
let
[
preprocessed-query
(
try
((
requiring-resolve
'metabase.query-processor.preprocess/preprocess
)
query
)
(
catch
Exception
e
(
log/info
e
"Failed to preprocess query, falling back to unprocessed"
)
false
))
query
(
or
preprocessed-query
query
)
required-perms
(
required-perms-for-query
query
:already-preprocessed?
(
boolean
preprocessed-query
))]
(
let
[
required-perms
(
required-perms-for-query
query
)]
(
check-data-perms
query
required-perms
:throw-exceptions?
false
)))
(
defn
can-query-table?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment