forked from forgejo/forgejo
Fix wrong permissions check when issues/prs shared operations (#9885)
* Fix wrong permissions check when issues/prs shared operations * move redirect to the last of the function * fix swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
81cfe243f9
commit
6d6f1d568e
11 changed files with 43 additions and 28 deletions
|
@ -508,19 +508,13 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
reqRepoReleaseWriter := context.RequireRepoWriter(models.UnitTypeReleases)
|
||||
reqRepoReleaseReader := context.RequireRepoReader(models.UnitTypeReleases)
|
||||
reqRepoWikiWriter := context.RequireRepoWriter(models.UnitTypeWiki)
|
||||
reqRepoIssueWriter := context.RequireRepoWriter(models.UnitTypeIssues)
|
||||
reqRepoIssueReader := context.RequireRepoReader(models.UnitTypeIssues)
|
||||
reqRepoPullsWriter := context.RequireRepoWriter(models.UnitTypePullRequests)
|
||||
reqRepoPullsReader := context.RequireRepoReader(models.UnitTypePullRequests)
|
||||
reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(models.UnitTypeIssues, models.UnitTypePullRequests)
|
||||
reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(models.UnitTypeIssues, models.UnitTypePullRequests)
|
||||
|
||||
reqRepoIssueWriter := func(ctx *context.Context) {
|
||||
if !ctx.Repo.CanWrite(models.UnitTypeIssues) {
|
||||
ctx.Error(403)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// ***** START: Organization *****
|
||||
m.Group("/org", func() {
|
||||
m.Group("", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue