diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:20:37 +0100 |
---|---|---|
committer | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:20:37 +0100 |
commit | f388661bda8097b5ff01548e6153c566690c9b5e (patch) | |
tree | d0bdf0785474f50eb42b6b4852922201620221cf /modules/context/repo.go | |
parent | 0b62aeb495c9c1daf816a754a0e4abbf8c62c2c0 (diff) | |
download | gitea-f388661bda8097b5ff01548e6153c566690c9b5e.tar.gz gitea-f388661bda8097b5ff01548e6153c566690c9b5e.zip |
ACCESS_MODE_* -> AccessMode*
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r-- | modules/context/repo.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 8dadf3a1e6..0212aece9c 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -51,22 +51,22 @@ type Repository struct { // IsOwner returns true if current user is the owner of repository. func (r *Repository) IsOwner() bool { - return r.AccessMode >= models.ACCESS_MODE_OWNER + return r.AccessMode >= models.AccessModeOwner } // IsAdmin returns true if current user has admin or higher access of repository. func (r *Repository) IsAdmin() bool { - return r.AccessMode >= models.ACCESS_MODE_ADMIN + return r.AccessMode >= models.AccessModeAdmin } // IsWriter returns true if current user has write or higher access of repository. func (r *Repository) IsWriter() bool { - return r.AccessMode >= models.ACCESS_MODE_WRITE + return r.AccessMode >= models.AccessModeWrite } // HasAccess returns true if the current user has at least read access for this repository func (r *Repository) HasAccess() bool { - return r.AccessMode >= models.ACCESS_MODE_READ + return r.AccessMode >= models.AccessModeRead } // CanEnableEditor returns true if repository is editable and user has proper access level. @@ -192,7 +192,7 @@ func RepoAssignment(args ...bool) macaron.Handler { // Admin has super access. if ctx.IsSigned && ctx.User.IsAdmin { - ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER + ctx.Repo.AccessMode = models.AccessModeOwner } else { mode, err := models.AccessLevel(ctx.User, repo) if err != nil { @@ -203,7 +203,7 @@ func RepoAssignment(args ...bool) macaron.Handler { } // Check access. - if ctx.Repo.AccessMode == models.ACCESS_MODE_NONE { + if ctx.Repo.AccessMode == models.AccessModeNone { if ctx.Query("go-get") == "1" { earlyResponseForGoGetMeta(ctx) return |