Skip to content
Snippets Groups Projects
Commit 9416382e authored by Cam Saül's avatar Cam Saül
Browse files

Include :can_write with GET /api/card/:id

parent 96421ca0
No related branches found
No related tags found
No related merge requests found
......@@ -181,7 +181,7 @@
"Get `Card` with ID."
[id]
(-> (read-check Card id)
(hydrate :creator :dashboard_count :labels)
(hydrate :creator :dashboard_count :labels :can_write)
(assoc :actor_id *current-user-id*)
(->> (events/publish-event! :card-read))
(dissoc :actor_id)))
......
......@@ -60,7 +60,7 @@
* `(partial current-user-has-full-permissions? :read)` (you must also implement `perms-objects-set` to use this)
* `(partial current-user-has-partial-permissions? :read)` (you must also implement `perms-objects-set` to use this)")
(can-write? ^Boolean [instance], ^Boolean [entity, ^Integer id]
(^{:hydrate :can_write} can-write? ^Boolean [instance], ^Boolean [entity, ^Integer id]
"Return whether `*current-user*` has *write* permissions for an object. You should use one of these implmentations:
* `(constantly true)`
......
......@@ -183,6 +183,7 @@
:id $
:display "table"
:visualization_settings {}
:can_write true
:created_at $
:database_id database-id ; these should be inferred from the dataset_query
:table_id table-id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment