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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
8d36a1e96a
Коммит
8b868828bf
@@ -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())
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user