File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,22 @@ func userOrgPublicRepoCond(userID int64) builder.Cond {
302
302
)
303
303
}
304
304
305
+ func userOrgPublicRepoCondPrivate (userID int64 ) builder.Cond {
306
+ return builder .And (
307
+ builder.Eq {"`repository`.is_private" : false },
308
+ builder .In ("`repository`.owner_id" ,
309
+ builder .Select ("`org_user`.org_id" ).
310
+ From ("org_user" ).
311
+ Join ("INNER" , "`user`" , "`user`.id = `org_user`.org_id" ).
312
+ Where (builder.Eq {
313
+ "`org_user`.uid" : userID ,
314
+ "`user`.type" : UserTypeOrganization ,
315
+ "`user`.visibility" : structs .VisibleTypePrivate ,
316
+ }),
317
+ ),
318
+ )
319
+ }
320
+
305
321
func userOrgPublicUnitRepoCond (userID , orgID int64 ) builder.Cond {
306
322
return userOrgPublicRepoCond (userID ).
307
323
And (builder.Eq {"`repository`.owner_id" : orgID })
@@ -364,7 +380,7 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
364
380
// B. We are in a team for
365
381
userOrgTeamRepoCond ("`repository`.id" , opts .OwnerID ),
366
382
// C. Public repositories in organizations that we are member of
367
- userOrgPublicRepoCond (opts .OwnerID ),
383
+ userOrgPublicRepoCondPrivate (opts .OwnerID ),
368
384
),
369
385
)
370
386
if ! opts .Private {
You can’t perform that action at this time.
0 commit comments