From 9be48b31c268574ca68234940b35768590e5b46e Mon Sep 17 00:00:00 2001 From: hoitih <10838836+hoitih@users.noreply.github.com> Date: Tue, 24 May 2022 15:33:30 +0200 Subject: [PATCH] Modified some comments to match the changes --- models/issue.go | 2 +- models/repo_list.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/issue.go b/models/issue.go index 302e9c112b249..2bc42434e5851 100644 --- a/models/issue.go +++ b/models/issue.go @@ -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 diff --git a/models/repo_list.go b/models/repo_list.go index 0d05a8cfec99e..4391402164606 100644 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -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`"). @@ -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), @@ -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