Skip to content
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

Fix wrong permissions check when issues/prs shared operations #9885

Merged
merged 5 commits into from
Jan 20, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 20, 2020

This PR also fixed a type param on /issues missed on #9842

Hint: If a page or an API is shared by issue and pullrequest, you must use CanWriteIssuesOrPulls(issue.IsPull) but not CanWrite(models.UnitTypeIssues) to check the permisson.

This PR will not be backport to v1.10.4 because it has been merged into #9884

@lunny lunny added this to the 1.12.0 milestone Jan 20, 2020
@codecov-io
Copy link

codecov-io commented Jan 20, 2020

Codecov Report

Merging #9885 into master will increase coverage by 0.12%.
The diff coverage is 79.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9885      +/-   ##
==========================================
+ Coverage   42.27%   42.39%   +0.12%     
==========================================
  Files         605      605              
  Lines       79270    79304      +34     
==========================================
+ Hits        33513    33624     +111     
+ Misses      41625    41521     -104     
- Partials     4132     4159      +27
Impacted Files Coverage Δ
routers/repo/activity.go 31.5% <0%> (-1.83%) ⬇️
modules/git/repo_stats.go 87.2% <100%> (+2.7%) ⬆️
modules/templates/helper.go 40.36% <50%> (+0.11%) ⬆️
models/repo_activity.go 66.1% <86.66%> (+13.93%) ⬆️
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
services/pull/temp_repo.go 31.62% <0%> (-2.57%) ⬇️
services/pull/check.go 54.54% <0%> (-2.1%) ⬇️
models/repo.go 47.27% <0%> (+0.24%) ⬆️
modules/migrations/gitea.go 7.8% <0%> (+0.9%) ⬆️
models/error.go 31.86% <0%> (+1.09%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a96a495...b880f0d. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 20, 2020
@lunny lunny mentioned this pull request Jan 20, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 20, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 20, 2020
@sapk sapk merged commit 6d6f1d5 into go-gitea:master Jan 20, 2020
@sapk
Copy link
Member

sapk commented Jan 20, 2020

@lunny please send backport

@lunny lunny deleted the lunny/fix_permissions_check branch January 20, 2020 15:00
lunny added a commit to lunny/gitea that referenced this pull request Jan 20, 2020
…ea#9885)

* Fix wrong permissions check when issues/prs shared operations

* move redirect to the last of the function

* fix swagger

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
@lunny lunny added the backport/done All backports for this PR have been created label Jan 20, 2020
lafriks added a commit that referenced this pull request Jan 20, 2020
…#9889)

* Fix wrong permissions check when issues/prs shared operations

* move redirect to the last of the function

* fix swagger

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants