makes POS page much less likely to break everything
This commit is contained in:
@@ -853,3 +853,21 @@
|
||||
:status "WARN")
|
||||
(transact-with-backoff tx (inc attempt)))
|
||||
(throw e))))))
|
||||
|
||||
(defn visible-clients [id]
|
||||
(cond
|
||||
(= (:user/role id) "none")
|
||||
#{}
|
||||
|
||||
(= (:user/role id) "admin")
|
||||
(->> (dc/q '[:find (pull ?e [:db/id :client/code])
|
||||
:in $
|
||||
:where [?e :client/code]]
|
||||
(dc/db conn))
|
||||
(map first)
|
||||
(map :db/id)
|
||||
(into #{}))
|
||||
|
||||
(#{"manager" "user" "power-user"} (:user/role id))
|
||||
(into #{}
|
||||
(map :db/id (:user/clients id [])))))
|
||||
|
||||
Reference in New Issue
Block a user