Adds manager type, blocks certain permissions

This commit is contained in:
Bryce Covert
2020-05-29 07:14:40 -07:00
parent e77e02137c
commit d9bf9867e4
19 changed files with 122 additions and 92 deletions

View File

@@ -71,6 +71,7 @@
%))
(assoc :vendor-id (:id (:vendor data)))
(assoc :yodlee-merchant-id (:id (:yodlee-merchant data)))
(update :description (fn [d] (when d (str/replace d #"\\" "\\\\"))))
(update :accounts (fn [as]
(map #(-> %
(update :id (fn [i] (if (some-> i (str/starts-with? "new-"))
@@ -99,6 +100,7 @@
:dom-lte
:dom-gte
:note])
(update :description (fn [d] (when d (str/replace d #"\\" "\\\\"))))
(assoc :yodlee-merchant-id (:id (:yodlee-merchant data)))
(assoc :client-id (:id (:client data)))
(assoc :bank-account-id (:id (:bank-account data))))}

View File

@@ -149,10 +149,11 @@
:subscription editing}
[:option {:value ":none"} "None"]
[:option {:value ":user"} "User"]
[:option {:value ":manager"} "Manager"]
[:option {:value ":admin"} "Admin"]]]]]]
(when (= ":user" (:role (:user editing)))
(when (#{":user" ":manager"} (:role (:user editing)))
[horizontal-field
[:label.label "Clients"]
[:div.control

View File

@@ -70,7 +70,6 @@
(re-frame/reg-event-db
::save-error
(fn [db [_ vendor]]
(println "ERROR?")
(-> db
(assoc-in [:admin :vendor :error] true)
(assoc-in [:admin :vendor :saving?] false))))
@@ -78,7 +77,6 @@
(re-frame/reg-event-db
::change
(fn [db [_ path value]]
(println path value)
(assoc-in db (concat [:admin :vendor] path)
value)))