From 2324092d6675b002d5ffe405936630249c14ab38 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sat, 4 Feb 2023 16:09:41 +0900 Subject: [PATCH] create admin user with default user visibility --- cmd/admin.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/admin.go b/cmd/admin.go index 8f8c68f9810c9..eafed24bdd6e2 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -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{