diff options
author | yp05327 <576951401@qq.com> | 2023-02-05 02:35:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 17:35:04 +0000 |
commit | e35f8e15a67e8268542d2442dac32993b6944043 (patch) | |
tree | 73cd75a767bb414696bebf9d88ee23d3f93dd349 /cmd/admin.go | |
parent | 8574a6433fab47b6f20997f024c176490dfad1c0 (diff) | |
download | gitea-e35f8e15a67e8268542d2442dac32993b6944043.tar.gz gitea-e35f8e15a67e8268542d2442dac32993b6944043.zip |
add default user visibility to cli command "admin user create" (#22750)
Fixes https://github.com/go-gitea/gitea/issues/22523
Diffstat (limited to 'cmd/admin.go')
-rw-r--r-- | cmd/admin.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/admin.go b/cmd/admin.go index 8f8c68f981..eafed24bdd 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{ |