0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-04 13:50:12 -05:00

Merge pull request #5465 from penpot/palba-fix-viewer-role-thumbnails

🐛 Fix viewer role is unable to generate thumbnails on dashboard
This commit is contained in:
Andrey Antukh 2024-12-13 11:16:32 +01:00 committed by GitHub
commit fd4d4ec6e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -402,7 +402,10 @@
[cfg {:keys [::rpc/profile-id file-id] :as params}]
(db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}]
(files/check-edition-permissions! conn profile-id file-id)
;; TODO For now we check read permissions instead of write,
;; to allow viewer users to update thumbnails. We might
;; review this approach on the future.
(files/check-read-permissions! conn profile-id file-id)
(when-not (db/read-only? conn)
(let [media (create-file-thumbnail! cfg params)]
{:uri (files/resolve-public-uri (:id media))