gitea源码

org_team.go 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // Copyright 2018 The Gitea Authors. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package structs
  5. // Team represents a team in an organization
  6. type Team struct {
  7. // The unique identifier of the team
  8. ID int64 `json:"id"`
  9. // The name of the team
  10. Name string `json:"name"`
  11. // The description of the team
  12. Description string `json:"description"`
  13. // The organization that the team belongs to
  14. Organization *Organization `json:"organization"`
  15. // Whether the team has access to all repositories in the organization
  16. IncludesAllRepositories bool `json:"includes_all_repositories"`
  17. // enum: none,read,write,admin,owner
  18. Permission string `json:"permission"`
  19. // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
  20. // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
  21. Units []string `json:"units"`
  22. // example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
  23. UnitsMap map[string]string `json:"units_map"`
  24. // Whether the team can create repositories in the organization
  25. CanCreateOrgRepo bool `json:"can_create_org_repo"`
  26. }
  27. // CreateTeamOption options for creating a team
  28. type CreateTeamOption struct {
  29. // required: true
  30. Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(255)"`
  31. // The description of the team
  32. Description string `json:"description" binding:"MaxSize(255)"`
  33. // Whether the team has access to all repositories in the organization
  34. IncludesAllRepositories bool `json:"includes_all_repositories"`
  35. // enum: read,write,admin
  36. Permission string `json:"permission"`
  37. // example: ["repo.actions","repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.ext_wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
  38. // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
  39. Units []string `json:"units"`
  40. // example: {"repo.actions","repo.packages","repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
  41. UnitsMap map[string]string `json:"units_map"`
  42. // Whether the team can create repositories in the organization
  43. CanCreateOrgRepo bool `json:"can_create_org_repo"`
  44. }
  45. // EditTeamOption options for editing a team
  46. type EditTeamOption struct {
  47. // required: true
  48. Name string `json:"name" binding:"AlphaDashDot;MaxSize(255)"`
  49. // The description of the team
  50. Description *string `json:"description" binding:"MaxSize(255)"`
  51. // Whether the team has access to all repositories in the organization
  52. IncludesAllRepositories *bool `json:"includes_all_repositories"`
  53. // enum: read,write,admin
  54. Permission string `json:"permission"`
  55. // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
  56. // Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
  57. Units []string `json:"units"`
  58. // example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
  59. UnitsMap map[string]string `json:"units_map"`
  60. // Whether the team can create repositories in the organization
  61. CanCreateOrgRepo *bool `json:"can_create_org_repo"`
  62. }