Skip to content

Commit c42083a

Browse files
authored
Allow non-admin users to delete review requests (#29057)
Fix #14459 The following users can add/remove review requests of a PR - the poster of the PR - the owner or collaborators of the repository - members with read permission on the pull requests unit
1 parent 267dbb4 commit c42083a

33 files changed

+656
-103
lines changed

models/fixtures/access.yml

+24
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,27 @@
135135
user_id: 31
136136
repo_id: 28
137137
mode: 4
138+
139+
-
140+
id: 24
141+
user_id: 38
142+
repo_id: 60
143+
mode: 2
144+
145+
-
146+
id: 25
147+
user_id: 38
148+
repo_id: 61
149+
mode: 1
150+
151+
-
152+
id: 26
153+
user_id: 39
154+
repo_id: 61
155+
mode: 1
156+
157+
-
158+
id: 27
159+
user_id: 40
160+
repo_id: 61
161+
mode: 4

models/fixtures/collaboration.yml

+6
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@
4545
repo_id: 22
4646
user_id: 18
4747
mode: 2 # write
48+
49+
-
50+
id: 9
51+
repo_id: 60
52+
user_id: 38
53+
mode: 2 # write

models/fixtures/email_address.yml

+24
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,27 @@
293293
lower_email: [email protected]
294294
is_activated: true
295295
is_primary: true
296+
297+
-
298+
id: 38
299+
uid: 38
300+
301+
lower_email: [email protected]
302+
is_activated: true
303+
is_primary: true
304+
305+
-
306+
id: 39
307+
uid: 39
308+
309+
lower_email: [email protected]
310+
is_activated: true
311+
is_primary: true
312+
313+
-
314+
id: 40
315+
uid: 40
316+
317+
lower_email: [email protected]
318+
is_activated: true
319+
is_primary: true

models/fixtures/issue.yml

+34
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,37 @@
338338
created_unix: 978307210
339339
updated_unix: 978307210
340340
is_locked: false
341+
342+
-
343+
id: 21
344+
repo_id: 60
345+
index: 1
346+
poster_id: 39
347+
original_author_id: 0
348+
name: repo60 pull1
349+
content: content for the 1st issue
350+
milestone_id: 0
351+
priority: 0
352+
is_closed: false
353+
is_pull: true
354+
num_comments: 0
355+
created_unix: 1707270422
356+
updated_unix: 1707270422
357+
is_locked: false
358+
359+
-
360+
id: 22
361+
repo_id: 61
362+
index: 1
363+
poster_id: 40
364+
original_author_id: 0
365+
name: repo61 pull1
366+
content: content for the 1st issue
367+
milestone_id: 0
368+
priority: 0
369+
is_closed: false
370+
is_pull: true
371+
num_comments: 0
372+
created_unix: 1707270422
373+
updated_unix: 1707270422
374+
is_locked: false

models/fixtures/org_user.yml

+18
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,21 @@
9999
uid: 5
100100
org_id: 36
101101
is_public: true
102+
103+
-
104+
id: 18
105+
uid: 38
106+
org_id: 41
107+
is_public: true
108+
109+
-
110+
id: 19
111+
uid: 39
112+
org_id: 41
113+
is_public: true
114+
115+
-
116+
id: 20
117+
uid: 40
118+
org_id: 41
119+
is_public: true

models/fixtures/pull_request.yml

+18
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,21 @@
9999
index: 1
100100
head_repo_id: 23
101101
base_repo_id: 23
102+
103+
-
104+
id: 9
105+
type: 0 # gitea pull request
106+
status: 2 # mergable
107+
issue_id: 21
108+
index: 1
109+
head_repo_id: 60
110+
base_repo_id: 60
111+
112+
-
113+
id: 10
114+
type: 0 # gitea pull request
115+
status: 2 # mergable
116+
issue_id: 22
117+
index: 1
118+
head_repo_id: 61
119+
base_repo_id: 61

models/fixtures/repo_unit.yml

+42
Original file line numberDiff line numberDiff line change
@@ -676,3 +676,45 @@
676676
type: 1
677677
config: "{}"
678678
created_unix: 946684810
679+
680+
-
681+
id: 102
682+
repo_id: 60
683+
type: 1
684+
config: "{}"
685+
created_unix: 946684810
686+
687+
-
688+
id: 103
689+
repo_id: 60
690+
type: 2
691+
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
692+
created_unix: 946684810
693+
694+
-
695+
id: 104
696+
repo_id: 60
697+
type: 3
698+
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
699+
created_unix: 946684810
700+
701+
-
702+
id: 105
703+
repo_id: 61
704+
type: 1
705+
config: "{}"
706+
created_unix: 946684810
707+
708+
-
709+
id: 106
710+
repo_id: 61
711+
type: 2
712+
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
713+
created_unix: 946684810
714+
715+
-
716+
id: 107
717+
repo_id: 61
718+
type: 3
719+
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
720+
created_unix: 946684810

models/fixtures/repository.yml

+62
Original file line numberDiff line numberDiff line change
@@ -1706,3 +1706,65 @@
17061706
is_private: true
17071707
status: 0
17081708
num_issues: 0
1709+
1710+
-
1711+
id: 60
1712+
owner_id: 40
1713+
owner_name: user40
1714+
lower_name: repo60
1715+
name: repo60
1716+
default_branch: main
1717+
num_watches: 0
1718+
num_stars: 0
1719+
num_forks: 0
1720+
num_issues: 0
1721+
num_closed_issues: 0
1722+
num_pulls: 1
1723+
num_closed_pulls: 0
1724+
num_milestones: 0
1725+
num_closed_milestones: 0
1726+
num_projects: 0
1727+
num_closed_projects: 0
1728+
is_private: false
1729+
is_empty: false
1730+
is_archived: false
1731+
is_mirror: false
1732+
status: 0
1733+
is_fork: false
1734+
fork_id: 0
1735+
is_template: false
1736+
template_id: 0
1737+
size: 0
1738+
is_fsck_enabled: true
1739+
close_issues_via_commit_in_any_branch: false
1740+
1741+
-
1742+
id: 61
1743+
owner_id: 41
1744+
owner_name: org41
1745+
lower_name: repo61
1746+
name: repo61
1747+
default_branch: main
1748+
num_watches: 0
1749+
num_stars: 0
1750+
num_forks: 0
1751+
num_issues: 0
1752+
num_closed_issues: 0
1753+
num_pulls: 1
1754+
num_closed_pulls: 0
1755+
num_milestones: 0
1756+
num_closed_milestones: 0
1757+
num_projects: 0
1758+
num_closed_projects: 0
1759+
is_private: false
1760+
is_empty: false
1761+
is_archived: false
1762+
is_mirror: false
1763+
status: 0
1764+
is_fork: false
1765+
fork_id: 0
1766+
is_template: false
1767+
template_id: 0
1768+
size: 0
1769+
is_fsck_enabled: true
1770+
close_issues_via_commit_in_any_branch: false

models/fixtures/team.yml

+22
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,25 @@
217217
num_members: 1
218218
includes_all_repositories: false
219219
can_create_org_repo: true
220+
221+
-
222+
id: 21
223+
org_id: 41
224+
lower_name: owners
225+
name: Owners
226+
authorize: 4 # owner
227+
num_repos: 1
228+
num_members: 1
229+
includes_all_repositories: true
230+
can_create_org_repo: true
231+
232+
-
233+
id: 22
234+
org_id: 41
235+
lower_name: team1
236+
name: Team1
237+
authorize: 1 # read
238+
num_repos: 1
239+
num_members: 2
240+
includes_all_repositories: false
241+
can_create_org_repo: false

models/fixtures/team_repo.yml

+12
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,15 @@
6363
org_id: 17
6464
team_id: 9
6565
repo_id: 24
66+
67+
-
68+
id: 12
69+
org_id: 41
70+
team_id: 21
71+
repo_id: 61
72+
73+
-
74+
id: 13
75+
org_id: 41
76+
team_id: 22
77+
repo_id: 61

models/fixtures/team_unit.yml

+36
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,39 @@
286286
team_id: 2
287287
type: 8
288288
access_mode: 2
289+
290+
-
291+
id: 49
292+
team_id: 21
293+
type: 1
294+
access_mode: 4
295+
296+
-
297+
id: 50
298+
team_id: 21
299+
type: 2
300+
access_mode: 4
301+
302+
-
303+
id: 51
304+
team_id: 21
305+
type: 3
306+
access_mode: 4
307+
308+
-
309+
id: 52
310+
team_id: 22
311+
type: 1
312+
access_mode: 1
313+
314+
-
315+
id: 53
316+
team_id: 22
317+
type: 2
318+
access_mode: 1
319+
320+
-
321+
id: 54
322+
team_id: 22
323+
type: 3
324+
access_mode: 1

models/fixtures/team_user.yml

+18
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,21 @@
129129
org_id: 17
130130
team_id: 9
131131
uid: 15
132+
133+
-
134+
id: 23
135+
org_id: 41
136+
team_id: 21
137+
uid: 40
138+
139+
-
140+
id: 24
141+
org_id: 41
142+
team_id: 22
143+
uid: 38
144+
145+
-
146+
id: 25
147+
org_id: 41
148+
team_id: 22
149+
uid: 39

0 commit comments

Comments
 (0)