aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-02-18 09:25:35 +0100
committerGitHub <noreply@github.com>2021-02-18 16:25:35 +0800
commit8d5c795cc4cc6b254a897461a860f25b0708ee14 (patch)
tree691eec6fd0abe6824f84e6eb64f4d2f086918a3a /modules/structs
parentce0346448ff6c8e92f794e7b724f3d4333412a9b (diff)
downloadgitea-8d5c795cc4cc6b254a897461a860f25b0708ee14.tar.gz
gitea-8d5c795cc4cc6b254a897461a860f25b0708ee14.zip
[API] Add Restricted Field to User (#14630)
* Expose Restricted field for User * Add Option to Change Restricted on User via adminEditUser API * Add test who change restricted & test if it changed it ... * make generate-swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/admin_user.go1
-rw-r--r--modules/structs/user.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/structs/admin_user.go b/modules/structs/admin_user.go
index 8cd4dc59e8..ee1738579a 100644
--- a/modules/structs/admin_user.go
+++ b/modules/structs/admin_user.go
@@ -41,4 +41,5 @@ type EditUserOption struct {
MaxRepoCreation *int `json:"max_repo_creation"`
ProhibitLogin *bool `json:"prohibit_login"`
AllowCreateOrganization *bool `json:"allow_create_organization"`
+ Restricted *bool `json:"restricted"`
}
diff --git a/modules/structs/user.go b/modules/structs/user.go
index bf52cc9ed6..511e4c56ce 100644
--- a/modules/structs/user.go
+++ b/modules/structs/user.go
@@ -30,6 +30,8 @@ type User struct {
LastLogin time.Time `json:"last_login,omitempty"`
// swagger:strfmt date-time
Created time.Time `json:"created,omitempty"`
+ // Is user restricted
+ Restricted bool `json:"restricted"`
}
// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility