File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ var (
115
115
Name : "access-token" ,
116
116
Usage : "Generate access token for the user" ,
117
117
},
118
+ cli.BoolFlag {
119
+ Name : "restricted" ,
120
+ Usage : "Make a restricted user account" ,
121
+ },
118
122
},
119
123
}
120
124
@@ -560,6 +564,12 @@ func runCreateUser(c *cli.Context) error {
560
564
changePassword = c .Bool ("must-change-password" )
561
565
}
562
566
567
+ restricted := util .OptionalBoolNone
568
+
569
+ if c .IsSet ("restricted" ) {
570
+ restricted = util .OptionalBoolOf (c .Bool ("restricted" ))
571
+ }
572
+
563
573
u := & user_model.User {
564
574
Name : username ,
565
575
Email : c .String ("email" ),
@@ -569,7 +579,8 @@ func runCreateUser(c *cli.Context) error {
569
579
}
570
580
571
581
overwriteDefault := & user_model.CreateUserOverwriteOptions {
572
- IsActive : util .OptionalBoolTrue ,
582
+ IsActive : util .OptionalBoolTrue ,
583
+ IsRestricted : restricted ,
573
584
}
574
585
575
586
if err := user_model .CreateUser (u , overwriteDefault ); err != nil {
You can’t perform that action at this time.
0 commit comments