Whitelist users who can create repos

This commit is contained in:
Oskar Thorén 2017-10-31 10:41:22 -05:00
parent d9dc24d724
commit ca193867e3

View File

@ -180,6 +180,12 @@
(dissoc :email) (dissoc :email)
(assoc :status-team-member? status-member?))})) (assoc :status-team-member? status-member?))}))
;; NOTE: This assumes username can be trusted and not tampered with
(def user-whitelisted?
#{"oskarth"
"annadanchenko"
"tpatja"})
(defapi service-routes (defapi service-routes
(when (:dev env) (when (:dev env)
{:swagger {:ui "/swagger-ui" {:swagger {:ui "/swagger-ui"
@ -256,4 +262,4 @@
;; NOTE: Don't allow anyone to create repos; manual add ;; NOTE: Don't allow anyone to create repos; manual add
:auth-rules authenticated? :auth-rules authenticated?
:current-user user :current-user user
(handle-toggle-repo user params false))))) (handle-toggle-repo user params user-whitelisted?)))))