feat: pass integations flag to user info

This commit is contained in:
fiftin 2024-03-06 22:48:40 +01:00
parent e8a679cec6
commit 80407b36b5

View File

@ -21,11 +21,13 @@ func getUser(w http.ResponseWriter, r *http.Request) {
var user struct {
db.User
CanCreateProject bool `json:"can_create_project"`
CanCreateProject bool `json:"can_create_project"`
IntegrationsEnable bool `json:"integrations_enable"`
}
user.User = *context.Get(r, "user").(*db.User)
user.CanCreateProject = user.Admin || util.Config.NonAdminCanCreateProject
user.IntegrationsEnable = util.Config.IntegrationsEnable
helpers.WriteJSON(w, http.StatusOK, user)
}