Skip to content

Commit

Permalink
add default user visibility to cli command "admin user create" (#22750)
Browse files Browse the repository at this point in the history
Fixes #22523
  • Loading branch information
yp05327 committed Feb 4, 2023
1 parent 8574a64 commit e35f8e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/admin.go
Expand Up @@ -578,12 +578,16 @@ func runCreateUser(c *cli.Context) error {
restricted = util.OptionalBoolOf(c.Bool("restricted"))
}

// default user visibility in app.ini
visibility := setting.Service.DefaultUserVisibilityMode

u := &user_model.User{
Name: username,
Email: c.String("email"),
Passwd: password,
IsAdmin: c.Bool("admin"),
MustChangePassword: changePassword,
Visibility: visibility,
}

overwriteDefault := &user_model.CreateUserOverwriteOptions{
Expand Down

0 comments on commit e35f8e1

Please sign in to comment.