diff options
author | prixone <prixone@users.noreply.github.com> | 2017-03-29 22:05:32 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-03-29 21:05:32 -0400 |
commit | 8b868828bfe769e65bdda49091be2161b19d5ceb (patch) | |
tree | b3a33a6f1b5f705e0f68ab2072e41c5ffef933b5 /api4/user.go | |
parent | 8d36a1e96a12ba51bb95168f7deed797d53c266e (diff) | |
download | chat-8b868828bfe769e65bdda49091be2161b19d5ceb.tar.gz chat-8b868828bfe769e65bdda49091be2161b19d5ceb.tar.bz2 chat-8b868828bfe769e65bdda49091be2161b19d5ceb.zip |
PLT 6125 Allow system admins to create users on closed servers (#5908)
* Update user.go
Added method to create user accounts using a privileged system_admin account
* Update user.go
Added respective method to handle the the APIv4 call to create users with privileged account(system_admin) by passing server restrictions of EnableUserCreation and/or EnableOpenServer set to false.
* Update user_test.go
Added test case
Diffstat (limited to 'api4/user.go')
-rw-r--r-- | api4/user.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/api4/user.go b/api4/user.go index 66f1b7a88..4eb4479c2 100644 --- a/api4/user.go +++ b/api4/user.go @@ -72,6 +72,8 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) { ruser, err = app.CreateUserWithHash(user, hash, r.URL.Query().Get("d"), c.GetSiteURL()) } else if len(inviteId) > 0 { ruser, err = app.CreateUserWithInviteId(user, inviteId, c.GetSiteURL()) + } else if c.IsSystemAdmin() { + ruser, err = app.CreateUserAsAdmin(user, c.GetSiteURL()) } else { ruser, err = app.CreateUserFromSignup(user, c.GetSiteURL()) } |