You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin_user.go 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package structs
  5. import "time"
  6. // CreateUserOption create user options
  7. type CreateUserOption struct {
  8. SourceID int64 `json:"source_id"`
  9. LoginName string `json:"login_name"`
  10. // required: true
  11. Username string `json:"username" binding:"Required;Username;MaxSize(40)"`
  12. FullName string `json:"full_name" binding:"MaxSize(100)"`
  13. // required: true
  14. // swagger:strfmt email
  15. Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
  16. Password string `json:"password" binding:"MaxSize(255)"`
  17. MustChangePassword *bool `json:"must_change_password"`
  18. SendNotify bool `json:"send_notify"`
  19. Restricted *bool `json:"restricted"`
  20. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  21. // For explicitly setting the user creation timestamp. Useful when users are
  22. // migrated from other systems. When omitted, the user's creation timestamp
  23. // will be set to "now".
  24. Created *time.Time `json:"created_at"`
  25. }
  26. // EditUserOption edit user options
  27. type EditUserOption struct {
  28. // required: true
  29. SourceID int64 `json:"source_id"`
  30. // required: true
  31. LoginName string `json:"login_name" binding:"Required"`
  32. // swagger:strfmt email
  33. Email *string `json:"email" binding:"MaxSize(254)"`
  34. FullName *string `json:"full_name" binding:"MaxSize(100)"`
  35. Password string `json:"password" binding:"MaxSize(255)"`
  36. MustChangePassword *bool `json:"must_change_password"`
  37. Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
  38. Location *string `json:"location" binding:"MaxSize(50)"`
  39. Description *string `json:"description" binding:"MaxSize(255)"`
  40. Active *bool `json:"active"`
  41. Admin *bool `json:"admin"`
  42. AllowGitHook *bool `json:"allow_git_hook"`
  43. AllowImportLocal *bool `json:"allow_import_local"`
  44. MaxRepoCreation *int `json:"max_repo_creation"`
  45. ProhibitLogin *bool `json:"prohibit_login"`
  46. AllowCreateOrganization *bool `json:"allow_create_organization"`
  47. Restricted *bool `json:"restricted"`
  48. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  49. }