renamed company to client.

This commit is contained in:
Bryce Covert
2019-01-18 07:44:12 -08:00
parent 583752d740
commit 775150131e
38 changed files with 250 additions and 306 deletions

View File

@@ -47,14 +47,14 @@
(when-not (= "admin" (:user/role id))
(throw-unauthorized)))
(defn can-see-company? [identity company]
(defn can-see-client? [identity client]
(or (= "admin" (:user/role identity))
((set (map :db/id (:user/clients identity))) (:db/id company))
((set (map :db/id (:user/clients identity))) company)))
((set (map :db/id (:user/clients identity))) (:db/id client))
((set (map :db/id (:user/clients identity))) client)))
(defn assert-can-see-company [identity company]
(when-not (can-see-company? identity company)
(println "IDENTITY " identity " can not see company " company)
(defn assert-can-see-client [identity client]
(when-not (can-see-client? identity client)
(println "IDENTITY " identity " can not see company " client)
(throw-unauthorized)))
(defn limited-clients [id]