Skip to content

Commit 351e0d2

Browse files
committed
Fix GetRepositoryAccesses to use only explicit
1 parent 5f98b2c commit 351e0d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/access.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ func accessLevel(e Engine, user *User, repo *Repository) (AccessMode, error) {
100100
return a.Mode, nil
101101
}
102102

103-
// GetRepositoryAccesses finds all repositories with their access mode where a user has any kind of access but does not own.
103+
// GetRepositoryAccesses finds all repositories with their access mode
104+
// where a user has any kind of **explicit** access but does not own.
104105
func (user *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error) {
105106
// Xorm doesn't currently support such complex queries, so we first
106107
// retrieve the list of repositories; later we will retrieve the best
107108
// set of permissions for each and relate each other.
108109
rows, err := x.
109-
Where(accessibleRepositoryCondition(user)).
110+
Where(accessibleRepositoryConditionExplicit(user, true)).
110111
And("repository.owner_id <> ?", user.ID).
111112
Rows(new(Repository))
112113
if err != nil {

0 commit comments

Comments
 (0)