Skip to content

Commit

Permalink
Modified some comments to match the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hoitih committed May 24, 2022
1 parent 30550c3 commit 9be48b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ func issuePullAccessibleRepoCond(repoIDstr string, userID int64, org *organizati
cond = cond.And(
builder.Or(
userOwnedRepoCond(userID), // owned repos
userAccessRepoCond(repoIDstr, userID), // collaboration repos
userAccessRepoCond(repoIDstr, userID), // user can access repo in a unit independent way
userAssignedRepoCond(repoIDstr, userID), // user has been assigned accessible public repos
userMentionedRepoCond(repoIDstr, userID), // user has been mentioned accessible public repos
userCreateIssueRepoCond(repoIDstr, userID, isPull), // user has created issue/pr accessible public repos
Expand Down
6 changes: 3 additions & 3 deletions models/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func teamUnitsRepoCond(id string, userID, orgID, teamID int64, units ...unit.Typ
))
}

// userAccessRepoCond returns a condition for selecting all repositories a user has access to
// userAccessRepoCond returns a condition for selecting all repositories a user has unit independent access to
func userAccessRepoCond(idStr string, userID int64) builder.Cond {
return builder.In(idStr, builder.Select("repo_id").
From("`access`").
Expand Down Expand Up @@ -425,7 +425,7 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
builder.Neq{"owner_id": opts.OwnerID},
// 2. But we can see because of:
builder.Or(
// A. We have access
// A. We have unit independent access
userAccessRepoCond("`repository`.id", opts.OwnerID),
// B. We are in a team for
userOrgTeamRepoCond("`repository`.id", opts.OwnerID),
Expand Down Expand Up @@ -607,7 +607,7 @@ func accessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu
}

if user != nil {
// 2. Be able to see all repositories that we have direct access to
// 2. Be able to see all repositories that we have unit independent access to
// 3. Be able to see all repositories through team membership(s)
if unitType == unit.TypeInvalid {
// Regardless of UnitType
Expand Down

0 comments on commit 9be48b3

Please sign in to comment.