forked from NYANDEV/forgejo
Restricted users only see repos in orgs which their team was assigned to (#28025)
--- *Sponsored by Kithara Software GmbH*
This commit is contained in:
parent
d4d05f9f1b
commit
5ab3782f11
1 changed files with 5 additions and 5 deletions
|
@ -652,12 +652,12 @@ func AccessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu
|
||||||
userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType),
|
userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
cond = cond.Or(
|
// 4. Repositories that we directly own
|
||||||
// 4. Repositories that we directly own
|
cond = cond.Or(builder.Eq{"`repository`.owner_id": user.ID})
|
||||||
builder.Eq{"`repository`.owner_id": user.ID},
|
if !user.IsRestricted {
|
||||||
// 5. Be able to see all public repos in private organizations that we are an org_user of
|
// 5. Be able to see all public repos in private organizations that we are an org_user of
|
||||||
userOrgPublicRepoCond(user.ID),
|
cond = cond.Or(userOrgPublicRepoCond(user.ID))
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cond
|
return cond
|
||||||
|
|
Loading…
Reference in a new issue