A fork of Gitea (see branch `mj`) adding Majority Judgment Polls 𐄷 over Issues and Merge Requests. https://git.mieuxvoter.fr
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.

118 lines
1.6 KiB

Restricted users (#6274) * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago
  1. -
  2. id: 1
  3. org_id: 3
  4. lower_name: owners
  5. name: Owners
  6. authorize: 4 # owner
  7. num_repos: 3
  8. num_members: 1
  9. -
  10. id: 2
  11. org_id: 3
  12. lower_name: team1
  13. name: team1
  14. authorize: 2 # write
  15. num_repos: 1
  16. num_members: 2
  17. -
  18. id: 3
  19. org_id: 6
  20. lower_name: owners
  21. name: Owners
  22. authorize: 4 # owner
  23. num_repos: 0
  24. num_members: 1
  25. -
  26. id: 4
  27. org_id: 7
  28. lower_name: owners
  29. name: Owners
  30. authorize: 4 # owner
  31. num_repos: 0
  32. num_members: 1
  33. -
  34. id: 5
  35. org_id: 17
  36. lower_name: owners
  37. name: Owners
  38. authorize: 4 # owner
  39. num_repos: 2
  40. num_members: 2
  41. -
  42. id: 6
  43. org_id: 19
  44. lower_name: owners
  45. name: Owners
  46. authorize: 4 # owner
  47. num_repos: 2
  48. num_members: 1
  49. -
  50. id: 7
  51. org_id: 3
  52. lower_name: test_team
  53. name: test_team
  54. authorize: 2 # write
  55. num_repos: 1
  56. num_members: 1
  57. -
  58. id: 8
  59. org_id: 17
  60. lower_name: test_team
  61. name: test_team
  62. authorize: 2 # write
  63. num_repos: 1
  64. num_members: 1
  65. -
  66. id: 9
  67. org_id: 17
  68. lower_name: review_team
  69. name: review_team
  70. authorize: 1 # read
  71. num_repos: 1
  72. num_members: 2
  73. -
  74. id: 10
  75. org_id: 25
  76. lower_name: notowners
  77. name: NotOwners
  78. authorize: 1 # owner
  79. num_repos: 0
  80. num_members: 1
  81. -
  82. id: 11
  83. org_id: 26
  84. lower_name: team11
  85. name: team11
  86. authorize: 1 # read
  87. num_repos: 0
  88. num_members: 0
  89. -
  90. id: 12
  91. org_id: 3
  92. lower_name: team12creators
  93. name: team12Creators
  94. authorize: 3 # admin
  95. num_repos: 0
  96. num_members: 1
  97. can_create_org_repo: true
  98. -
  99. id: 13
  100. org_id: 6
  101. lower_name: team13notcreators
  102. name: team13NotCreators
  103. authorize: 3 # admin
  104. num_repos: 0
  105. num_members: 1
  106. can_create_org_repo: false