diff options
author | Unknwon <u@gogs.io> | 2015-08-15 00:42:43 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-15 00:42:43 +0800 |
commit | cec38f2a8cf4f6721cc412d1d6cf3ea6f25b16c7 (patch) | |
tree | e17c7394bf6050f9b6133dd588ac1a2f445207e8 /modules/middleware/repo.go | |
parent | d07c081920fd3ca395250ac9b5877a764171f4cd (diff) | |
download | gitea-cec38f2a8cf4f6721cc412d1d6cf3ea6f25b16c7.tar.gz gitea-cec38f2a8cf4f6721cc412d1d6cf3ea6f25b16c7.zip |
able edit issue labels/milestone/assignee
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r-- | modules/middleware/repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index c4c53c03a2..d3995d2979 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -324,8 +324,8 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { ctx.Data["Title"] = u.Name + "/" + repo.Name ctx.Data["Repository"] = repo ctx.Data["Owner"] = ctx.Repo.Repository.Owner - ctx.Data["IsRepositoryOwner"] = ctx.Repo.AccessMode >= models.ACCESS_MODE_WRITE - ctx.Data["IsRepositoryAdmin"] = ctx.Repo.AccessMode >= models.ACCESS_MODE_ADMIN + ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner() + ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin() ctx.Data["DisableSSH"] = setting.DisableSSH ctx.Repo.CloneLink, err = repo.CloneLink() @@ -388,7 +388,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { func RequireRepoAdmin() macaron.Handler { return func(ctx *Context) { - if ctx.Repo.AccessMode < models.ACCESS_MODE_ADMIN { + if !ctx.Repo.IsAdmin() { if !ctx.IsSigned { ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) ctx.Redirect(setting.AppSubUrl + "/user/login") |