diff options
author | Yarden Shoham <hrsi88@gmail.com> | 2023-02-08 19:04:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 11:04:38 -0600 |
commit | 638fbd0b78f3464b5cebcad26d3f18cb32183069 (patch) | |
tree | e11970fe0fb3ed19bd8f1f7c50d49ba9207b08e7 | |
parent | 3647e62ef9951368af2b2824e82f5ea76cb6ad8a (diff) | |
download | gitea-638fbd0b78f3464b5cebcad26d3f18cb32183069.tar.gz gitea-638fbd0b78f3464b5cebcad26d3f18cb32183069.zip |
add default user visibility to cli command "admin user create" (#22750) (#22760)
Backport #22750
Fixes https://github.com/go-gitea/gitea/issues/22523
Co-authored-by: yp05327 <576951401@qq.com>
-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 d33d17a53d..b56837bdf6 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -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{ |