summaryrefslogtreecommitdiffstats
path: root/modules/context/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r--modules/context/repo.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 555513c9e1..a59dc7da28 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -496,11 +496,16 @@ func RequireRepoWriter() macaron.Handler {
// LoadRepoUnits loads repsitory's units, it should be called after repository and user loaded
func LoadRepoUnits() macaron.Handler {
return func(ctx *Context) {
+ var isAdmin bool
+ if ctx.User != nil && ctx.User.IsAdmin {
+ isAdmin = true
+ }
+
var userID int64
if ctx.User != nil {
userID = ctx.User.ID
}
- err := ctx.Repo.Repository.LoadUnitsByUserID(userID)
+ err := ctx.Repo.Repository.LoadUnitsByUserID(userID, isAdmin)
if err != nil {
ctx.Handle(500, "LoadUnitsByUserID", err)
return