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 | |
parent | 0b62aeb495c9c1daf816a754a0e4abbf8c62c2c0 (diff) | |
download | gitea-f388661bda8097b5ff01548e6153c566690c9b5e.tar.gz gitea-f388661bda8097b5ff01548e6153c566690c9b5e.zip |
ACCESS_MODE_* -> AccessMode*
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/org.go | 2 | ||||
-rw-r--r-- | modules/context/repo.go | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/modules/context/org.go b/modules/context/org.go index 3804e210e6..acf83ff142 100644 --- a/modules/context/org.go +++ b/modules/context/org.go @@ -136,7 +136,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) { return } - ctx.Org.IsTeamAdmin = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.ACCESS_MODE_ADMIN + ctx.Org.IsTeamAdmin = ctx.Org.Team.IsOwnerTeam() || ctx.Org.Team.Authorize >= models.AccessModeAdmin ctx.Data["IsTeamAdmin"] = ctx.Org.IsTeamAdmin if requireTeamAdmin && !ctx.Org.IsTeamAdmin { ctx.Handle(404, "OrgAssignment", err) 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 |