adding power user role.

This commit is contained in:
2021-01-26 09:52:28 -08:00
parent 20634e73ef
commit 7eeb1737ab
7 changed files with 42 additions and 17 deletions

View File

@@ -51,6 +51,11 @@
(log/warn "user " id " not an admin!")
(throw-unauthorized)))
(defn assert-power-user [id]
(when-not (#{"power-user" "admin"} (:user/role id))
(log/warn "user " id " not an power-user!")
(throw-unauthorized)))
(defn can-see-client? [identity client]
(when (not client)
(log/warn "WARNING - permission checking for null client"))
@@ -72,7 +77,7 @@
(= (:user/role id) "admin")
nil
(#{"manager" "user"} (:user/role id))
(#{"manager" "user" "power-user"} (:user/role id))
(:user/clients id [])))
(defn result->page [results result-count key args]