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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package structs
  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;AlphaDashDot;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. // required: true
  17. Password string `json:"password" binding:"Required;MaxSize(255)"`
  18. MustChangePassword *bool `json:"must_change_password"`
  19. SendNotify bool `json:"send_notify"`
  20. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  21. }
  22. // EditUserOption edit user options
  23. type EditUserOption struct {
  24. // required: true
  25. SourceID int64 `json:"source_id"`
  26. // required: true
  27. LoginName string `json:"login_name" binding:"Required"`
  28. // swagger:strfmt email
  29. Email *string `json:"email" binding:"MaxSize(254)"`
  30. FullName *string `json:"full_name" binding:"MaxSize(100)"`
  31. Password string `json:"password" binding:"MaxSize(255)"`
  32. MustChangePassword *bool `json:"must_change_password"`
  33. Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"`
  34. Location *string `json:"location" binding:"MaxSize(50)"`
  35. Description *string `json:"description" binding:"MaxSize(255)"`
  36. Active *bool `json:"active"`
  37. Admin *bool `json:"admin"`
  38. AllowGitHook *bool `json:"allow_git_hook"`
  39. AllowImportLocal *bool `json:"allow_import_local"`
  40. MaxRepoCreation *int `json:"max_repo_creation"`
  41. ProhibitLogin *bool `json:"prohibit_login"`
  42. AllowCreateOrganization *bool `json:"allow_create_organization"`
  43. Restricted *bool `json:"restricted"`
  44. Visibility string `json:"visibility" binding:"In(,public,limited,private)"`
  45. }