Skip to content

Commit 97e948b

Browse files
committed
Added active and prohibit_login.
1 parent a6bfe59 commit 97e948b

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

modules/convert/user.go

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ func toUser(user *models.User, signed, authed bool) *api.User {
5555
result.IsAdmin = user.IsAdmin
5656
result.LastLogin = user.LastLoginUnix.AsTime()
5757
result.Language = user.Language
58+
result.IsActive = &user.IsActive
59+
result.ProhibitLogin = &user.ProhibitLogin
5860
}
5961
return result
6062
}

modules/structs/user.go

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ type User struct {
3333
Created time.Time `json:"created,omitempty"`
3434
// Is user restricted
3535
Restricted bool `json:"restricted"`
36+
// Is user active
37+
IsActive *bool `json:"active,omitempty"`
38+
// Is user login prohibited
39+
ProhibitLogin *bool `json:"prohibit_login,omitempty"`
3640
}
3741

3842
// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility

templates/swagger/v1_json.tmpl

+10
Original file line numberDiff line numberDiff line change
@@ -16246,6 +16246,11 @@
1624616246
"description": "User represents a user",
1624716247
"type": "object",
1624816248
"properties": {
16249+
"active": {
16250+
"description": "Is user active",
16251+
"type": "boolean",
16252+
"x-go-name": "IsActive"
16253+
},
1624916254
"avatar_url": {
1625016255
"description": "URL to the user's avatar",
1625116256
"type": "string",
@@ -16292,6 +16297,11 @@
1629216297
"type": "string",
1629316298
"x-go-name": "UserName"
1629416299
},
16300+
"prohibit_login": {
16301+
"description": "Is user login prohibited",
16302+
"type": "boolean",
16303+
"x-go-name": "ProhibitLogin"
16304+
},
1629516305
"restricted": {
1629616306
"description": "Is user restricted",
1629716307
"type": "boolean",

0 commit comments

Comments
 (0)