summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 16:13:31 +0000
committerFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 16:14:24 +0000
commit9cf95e4e37419fd2856ec941922b5a0c74d155e1 (patch)
tree37fe4bc42c382f34ca5ad00d36d74f4b13059e05
parent8c4588c4c9844bb9f5e39df5fcaadca7fd6170cd (diff)
downloadgitea-9cf95e4e37419fd2856ec941922b5a0c74d155e1.tar.gz
gitea-9cf95e4e37419fd2856ec941922b5a0c74d155e1.zip
Organization owners see all repositories & teams
-rw-r--r--modules/middleware/org.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/middleware/org.go b/modules/middleware/org.go
index 99c4cf9d5c..eb71020e69 100644
--- a/modules/middleware/org.go
+++ b/modules/middleware/org.go
@@ -88,9 +88,16 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
// Team.
if ctx.Org.IsMember {
- if err := org.GetUserTeams(ctx.User.Id); err != nil {
- ctx.Handle(500, "GetUserTeams", err)
- return
+ if ctx.Org.IsOwner {
+ if err := org.GetTeams(); err != nil {
+ ctx.Handle(500, "GetUserTeams", err)
+ return
+ }
+ } else {
+ if err := org.GetUserTeams(ctx.User.Id); err != nil {
+ ctx.Handle(500, "GetUserTeams", err)
+ return
+ }
}
}
@@ -98,6 +105,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
if len(teamName) > 0 {
teamExists := false
for _, team := range org.Teams {
+
if strings.ToLower(team.Name) == strings.ToLower(teamName) {
teamExists = true
ctx.Org.Team = team
@@ -125,7 +133,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
return
}
}
-
}
func OrgAssignment(args ...bool) macaron.Handler {