mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
feat: pass integations flag to user info
This commit is contained in:
parent
e8a679cec6
commit
80407b36b5
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user