summaryrefslogtreecommitdiffstats
path: root/routers/web/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/web.go')
-rw-r--r--routers/web/web.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index c0bb74da2e..69f737c3e1 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -10,7 +10,7 @@ import (
"os"
"path"
- "code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/httpcache"
@@ -486,18 +486,18 @@ func RegisterRoutes(m *web.Route) {
}
reqRepoAdmin := context.RequireRepoAdmin()
- reqRepoCodeWriter := context.RequireRepoWriter(models.UnitTypeCode)
- reqRepoCodeReader := context.RequireRepoReader(models.UnitTypeCode)
- 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)
- reqRepoPullsReader := context.RequireRepoReader(models.UnitTypePullRequests)
- reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(models.UnitTypeIssues, models.UnitTypePullRequests)
- reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(models.UnitTypeIssues, models.UnitTypePullRequests)
- reqRepoProjectsReader := context.RequireRepoReader(models.UnitTypeProjects)
- reqRepoProjectsWriter := context.RequireRepoWriter(models.UnitTypeProjects)
+ reqRepoCodeWriter := context.RequireRepoWriter(unit.TypeCode)
+ reqRepoCodeReader := context.RequireRepoReader(unit.TypeCode)
+ reqRepoReleaseWriter := context.RequireRepoWriter(unit.TypeReleases)
+ reqRepoReleaseReader := context.RequireRepoReader(unit.TypeReleases)
+ reqRepoWikiWriter := context.RequireRepoWriter(unit.TypeWiki)
+ reqRepoIssueWriter := context.RequireRepoWriter(unit.TypeIssues)
+ reqRepoIssueReader := context.RequireRepoReader(unit.TypeIssues)
+ reqRepoPullsReader := context.RequireRepoReader(unit.TypePullRequests)
+ reqRepoIssuesOrPullsWriter := context.RequireRepoWriterOr(unit.TypeIssues, unit.TypePullRequests)
+ reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(unit.TypeIssues, unit.TypePullRequests)
+ reqRepoProjectsReader := context.RequireRepoReader(unit.TypeProjects)
+ reqRepoProjectsWriter := context.RequireRepoWriter(unit.TypeProjects)
// ***** START: Organization *****
m.Group("/org", func() {
@@ -920,12 +920,12 @@ func RegisterRoutes(m *web.Route) {
m.Group("/activity", func() {
m.Get("", repo.Activity)
m.Get("/{period}", repo.Activity)
- }, context.RepoRef(), repo.MustBeNotEmpty, context.RequireRepoReaderOr(models.UnitTypePullRequests, models.UnitTypeIssues, models.UnitTypeReleases))
+ }, context.RepoRef(), repo.MustBeNotEmpty, context.RequireRepoReaderOr(unit.TypePullRequests, unit.TypeIssues, unit.TypeReleases))
m.Group("/activity_author_data", func() {
m.Get("", repo.ActivityAuthors)
m.Get("/{period}", repo.ActivityAuthors)
- }, context.RepoRef(), repo.MustBeNotEmpty, context.RequireRepoReaderOr(models.UnitTypeCode))
+ }, context.RepoRef(), repo.MustBeNotEmpty, context.RequireRepoReaderOr(unit.TypeCode))
m.Group("/archive", func() {
m.Get("/*", repo.Download)