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
… (#22760)

Backport #22750

Fixes #22523

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
yardenshoham and yp05327 committed Feb 8, 2023
1 parent 3647e62 commit 638fbd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/admin.go
Expand Up @@ -574,12 +574,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 638fbd0

Please sign in to comment.