-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
api: fix overly strict permissions on edit PR #15900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: fix overly strict permissions on edit PR #15900
Conversation
Codecov Report
@@ Coverage Diff @@
## main #15900 +/- ##
==========================================
- Coverage 44.03% 44.02% -0.01%
==========================================
Files 681 681
Lines 82340 82340
==========================================
- Hits 36256 36254 -2
+ Misses 40182 40179 -3
- Partials 5902 5907 +5
Continue to review full report at Codecov.
|
I think we just missed Poster, but the original permission check should be also there. |
@lunny I can't follow, how would you do it instead? :) Adding a new middleware |
Just change |
The permission is checked in the func itselve again ... |
Here is an alternative implementation, that does the additional permission check via middleware: main...noerw:fix-14025-variant2 (I don't think the (potentially) better readability in api.go on this 2nd variant is worth the additional complexity) |
Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]>
-> #16081 |
Co-authored-by: 6543 <[email protected]> Co-authored-by: Norwin <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]> Co-authored-by: zeripath <[email protected]>
We can drop this overly strict permission requirement, as the more granular check (
IsIssuePoster
) is done inrepo.EditPullRequest()
fixes #14025