File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,7 @@ func (u *User) GetOwnedOrganizations() (err error) {
538
538
}
539
539
540
540
// GetOrganizations returns paginated organizations that user belongs to.
541
+ // TODO: does not respect All and show orgs you privately participate
541
542
func (u * User ) GetOrganizations (opts * SearchOrganizationsOptions ) error {
542
543
sess := x .NewSession ()
543
544
defer sess .Close ()
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
17
17
"code.gitea.io/gitea/routers/api/v1/utils"
18
18
)
19
19
20
- func listUserOrgs (ctx * context.APIContext , u * models.User , all bool ) {
20
+ func listUserOrgs (ctx * context.APIContext , u * models.User ) {
21
21
22
22
listOptions := utils .GetListOptions (ctx )
23
23
showPrivate := ctx .IsSigned && (ctx .User .IsAdmin || ctx .User .ID == u .ID )
@@ -62,7 +62,7 @@ func ListMyOrgs(ctx *context.APIContext) {
62
62
// "200":
63
63
// "$ref": "#/responses/OrganizationList"
64
64
65
- listUserOrgs (ctx , ctx .User , true )
65
+ listUserOrgs (ctx , ctx .User )
66
66
}
67
67
68
68
// ListUserOrgs list user's orgs
@@ -94,7 +94,7 @@ func ListUserOrgs(ctx *context.APIContext) {
94
94
if ctx .Written () {
95
95
return
96
96
}
97
- listUserOrgs (ctx , u , ctx . User != nil && ( ctx . User . IsAdmin || ctx . User . ID == u . ID ) )
97
+ listUserOrgs (ctx , u )
98
98
}
99
99
100
100
// GetAll return list of all public organizations
You can’t perform that action at this time.
0 commit comments