Skip to content

Commit 470b195

Browse files
a1012112796lafriks
andauthored
Fix ListUserOrgs (#12910) (#12915)
fix #12891 Signed-off-by: a1012112796 <[email protected]> Co-authored-by: Lauris BH <[email protected]> Co-authored-by: Lauris BH <[email protected]>
1 parent 0917830 commit 470b195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/org/org.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func ListUserOrgs(ctx *context.APIContext) {
8484
if ctx.Written() {
8585
return
8686
}
87-
listUserOrgs(ctx, u, ctx.User.IsAdmin)
87+
listUserOrgs(ctx, u, ctx.User != nil && (ctx.User.IsAdmin || ctx.User.ID == u.ID))
8888
}
8989

9090
// GetAll return list of all public organizations

0 commit comments

Comments
 (0)