Usage metrics view access control fix
Allow all members of status-im organization to see Usage metrics view, instead of just Status team members.
This commit is contained in:
parent
56587f882b
commit
640cf8abd6
|
@ -5,7 +5,8 @@
|
||||||
[oauth :as oauth]
|
[oauth :as oauth]
|
||||||
[users :as users]
|
[users :as users]
|
||||||
[repos :as repos]
|
[repos :as repos]
|
||||||
[issues :as issues]]
|
[issues :as issues]
|
||||||
|
[orgs :as orgs]]
|
||||||
[ring.util.codec :as codec]
|
[ring.util.codec :as codec]
|
||||||
[clj-http.client :as http]
|
[clj-http.client :as http]
|
||||||
[commiteth.config :refer [env]]
|
[commiteth.config :refer [env]]
|
||||||
|
@ -106,8 +107,12 @@
|
||||||
|
|
||||||
(defn status-team-member?
|
(defn status-team-member?
|
||||||
[token]
|
[token]
|
||||||
(let [user-teams (map :name (users/my-teams (auth-params token)))]
|
(let [user-login (:login (users/me (auth-params token)))
|
||||||
(true? (some #(= "Status" %) user-teams))))
|
user-teams (map :name (users/my-teams (auth-params token)))
|
||||||
|
status-org-members (map :login (orgs/members "status-im" (self-auth-params)))]
|
||||||
|
(or
|
||||||
|
(true? (some #(= "Status" %) user-teams))
|
||||||
|
(true? (some #(= user-login %) status-org-members)))))
|
||||||
|
|
||||||
(defn our-webhooks
|
(defn our-webhooks
|
||||||
[owner repo token]
|
[owner repo token]
|
||||||
|
|
Loading…
Reference in New Issue