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
4bb2298d
Commit
4bb2298d
authored
8 years ago
by
Cam Saül
Browse files
Options
Downloads
Patches
Plain Diff
Hydrate :collection for GET /api/card
parent
c8074c3e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/api/card.clj
+1
-1
1 addition, 1 deletion
src/metabase/api/card.clj
src/metabase/models/permissions.clj
+5
-8
5 additions, 8 deletions
src/metabase/models/permissions.clj
with
6 additions
and
9 deletions
src/metabase/api/card.clj
+
1
−
1
View file @
4bb2298d
...
...
@@ -129,7 +129,7 @@
;; TODO - do we need to hydrate the cards' collections as well?
(
defn-
cards-for-filter-option
[
filter-option
model-id
label
collection
]
(
let
[
cards
(
->
((
filter-option->fn
(
or
filter-option
:all
))
model-id
)
(
hydrate
:creator
)
(
hydrate
:creator
:collection
)
hydrate-labels
hydrate-favorites
)]
;; Since labels and collections are hydrated in Clojure-land we need to wait until this point to apply label/collection filtering if applicable
...
...
This diff is collapsed.
Click to expand it.
src/metabase/models/permissions.clj
+
5
−
8
View file @
4bb2298d
...
...
@@ -174,15 +174,13 @@
(
defn-
pre-insert
[
permissions
]
(
u/prog1
permissions
(
assert-valid
permissions
)
;; NOCOMMIT
(
println
(
u/format-color
'green
"Granting permissions for group %d: %s"
(
:group_id
permissions
)
(
:object
permissions
)))))
(
log/debug
(
u/format-color
'green
"Granting permissions for group %d: %s"
(
:group_id
permissions
)
(
:object
permissions
)))))
(
defn-
pre-update
[
_
]
(
throw
(
Exception.
"You cannot update a permissions entry! Delete it and create a new one."
)))
(
defn-
pre-cascade-delete
[
permissions
]
;; NOCOMMIT
(
println
(
u/format-color
'red
"Revoking permissions for group %d: %s"
(
:group_id
permissions
)
(
:object
permissions
)))
(
log/debug
(
u/format-color
'red
"Revoking permissions for group %d: %s"
(
:group_id
permissions
)
(
:object
permissions
)))
(
assert-not-admin-group
permissions
))
...
...
@@ -468,10 +466,9 @@
(
defn
log-permissions-changes
"Log changes to the permissions graph."
[
old
new
]
;; NOCOMMIT
(
printf
"Changing permissions: 🔏\nFROM:\n%s\nTO:\n%s\n"
(
u/pprint-to-str
'magenta
old
)
(
u/pprint-to-str
'blue
new
)))
(
log/debug
(
format
"Changing permissions: 🔏\nFROM:\n%s\nTO:\n%s\n"
(
u/pprint-to-str
'magenta
old
)
(
u/pprint-to-str
'blue
new
))))
(
s/defn
^
:always-validate
update-graph!
"Update the permissions graph, making any changes neccesary to make it match NEW-GRAPH.
...
...
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