aboutsummaryrefslogtreecommitdiffstats
path: root/modules/middleware/org.go
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-11-28 22:31:06 +0100
committerAdam Strzelecki <ono@java.pl>2015-11-30 21:46:01 +0100
commite57b2dffa42e554810d9b3f027bd8c5e12ba7369 (patch)
tree848b72ca4cdd6b3cc4263551400b47619552b3a5 /modules/middleware/org.go
parentca96e04e5fafc179f2b0a5460754e0fb4fe9e2d8 (diff)
downloadgitea-e57b2dffa42e554810d9b3f027bd8c5e12ba7369.tar.gz
gitea-e57b2dffa42e554810d9b3f027bd8c5e12ba7369.zip
Admin should be able to see all organizations
This is follow-up for 56c66ee486b4b8d544201662de62a23f36e6a069 allowing admin to see private repositories, even when not being member of them.
Diffstat (limited to 'modules/middleware/org.go')
-rw-r--r--modules/middleware/org.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/middleware/org.go b/modules/middleware/org.go
index 29754bb929..37ba4deb1f 100644
--- a/modules/middleware/org.go
+++ b/modules/middleware/org.go
@@ -48,7 +48,12 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
return
}
- if ctx.IsSigned {
+ // Admin has super access.
+ if ctx.IsSigned && ctx.User.IsAdmin {
+ ctx.Org.IsOwner = true
+ ctx.Org.IsMember = true
+ ctx.Org.IsAdminTeam = true
+ } else if ctx.IsSigned {
ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.Id)
if ctx.Org.IsOwner {
ctx.Org.IsMember = true
@@ -68,6 +73,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
return
}
ctx.Data["IsOrganizationOwner"] = ctx.Org.IsOwner
+ ctx.Data["IsOrganizationMember"] = ctx.Org.IsMember
ctx.Org.OrgLink = setting.AppSubUrl + "/org/" + org.Name
ctx.Data["OrgLink"] = ctx.Org.OrgLink