mirror of
https://github.com/go-gitea/gitea
synced 2024-08-20 06:11:16 +02:00
Organization owners see all repositories & teams
This commit is contained in:
parent
8c4588c4c9
commit
9cf95e4e37
@ -88,16 +88,24 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
|
|||||||
|
|
||||||
// Team.
|
// Team.
|
||||||
if ctx.Org.IsMember {
|
if ctx.Org.IsMember {
|
||||||
|
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 {
|
if err := org.GetUserTeams(ctx.User.Id); err != nil {
|
||||||
ctx.Handle(500, "GetUserTeams", err)
|
ctx.Handle(500, "GetUserTeams", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
teamName := ctx.Params(":team")
|
teamName := ctx.Params(":team")
|
||||||
if len(teamName) > 0 {
|
if len(teamName) > 0 {
|
||||||
teamExists := false
|
teamExists := false
|
||||||
for _, team := range org.Teams {
|
for _, team := range org.Teams {
|
||||||
|
|
||||||
if strings.ToLower(team.Name) == strings.ToLower(teamName) {
|
if strings.ToLower(team.Name) == strings.ToLower(teamName) {
|
||||||
teamExists = true
|
teamExists = true
|
||||||
ctx.Org.Team = team
|
ctx.Org.Team = team
|
||||||
@ -125,7 +133,6 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func OrgAssignment(args ...bool) macaron.Handler {
|
func OrgAssignment(args ...bool) macaron.Handler {
|
||||||
|
Loading…
Reference in New Issue
Block a user