mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 12:40:12 +00:00
🐛 Set proper exception type on notauthorized requests.
This commit is contained in:
parent
9805f8b9f2
commit
af310854fc
@ -71,7 +71,7 @@
|
|||||||
(when-not (or (some :can-edit rows)
|
(when-not (or (some :can-edit rows)
|
||||||
(some :is-admin rows)
|
(some :is-admin rows)
|
||||||
(some :is-owner rows))
|
(some :is-owner rows))
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))))
|
:code :not-authorized))))
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +82,7 @@
|
|||||||
file-id profile-id
|
file-id profile-id
|
||||||
file-id profile-id])]
|
file-id profile-id])]
|
||||||
(when-not (seq rows)
|
(when-not (seq rows)
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))))
|
:code :not-authorized))))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
(when-not (or (some :can-edit rows)
|
(when-not (or (some :can-edit rows)
|
||||||
(some :is-admin rows)
|
(some :is-admin rows)
|
||||||
(some :is-owner rows))
|
(some :is-owner rows))
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))))
|
:code :not-authorized))))
|
||||||
|
|
||||||
(defn check-read-permissions!
|
(defn check-read-permissions!
|
||||||
@ -54,7 +54,7 @@
|
|||||||
project-id profile-id])]
|
project-id profile-id])]
|
||||||
|
|
||||||
(when-not (seq rows)
|
(when-not (seq rows)
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))))
|
:code :not-authorized))))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
(when-not (or (:can-edit row)
|
(when-not (or (:can-edit row)
|
||||||
(:is-admin row)
|
(:is-admin row)
|
||||||
(:is-owner row))
|
(:is-owner row))
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))
|
:code :not-authorized))
|
||||||
row))
|
row))
|
||||||
|
|
||||||
@ -41,7 +41,7 @@
|
|||||||
(let [row (db/exec-one! conn [sql:team-permissions profile-id team-id])]
|
(let [row (db/exec-one! conn [sql:team-permissions profile-id team-id])]
|
||||||
;; when row is found this means that read permission is granted.
|
;; when row is found this means that read permission is granted.
|
||||||
(when-not row
|
(when-not row
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :authorization
|
||||||
:code :not-authorized))
|
:code :not-authorized))
|
||||||
row))
|
row))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user