Skip to content

Commit dc8ef08

Browse files
committed
Improve comment
1 parent 351e0d2 commit dc8ef08

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

models/access.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ func accessLevel(e Engine, user *User, repo *Repository) (AccessMode, error) {
101101
}
102102

103103
// GetRepositoryAccesses finds all repositories with their access mode
104-
// where a user has any kind of **explicit** access but does not own.
104+
// where a user has any kind of **explicit** access but does not directly own.
105105
func (user *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error) {
106-
// Xorm doesn't currently support such complex queries, so we first
107-
// retrieve the list of repositories; later we will retrieve the best
108-
// set of permissions for each and relate each other.
106+
// A query that retrieves all repositories with their max
107+
// access mode can be made, but unfortunately Xorm doesn't seem to
108+
// support such complex queries (one that gets us both the repository
109+
// and the mode from a sub-query).
110+
// So, we first query for the list of repositories; later we will retrieve
111+
// the best set of permissions for each one and relate each other.
109112
rows, err := x.
110113
Where(accessibleRepositoryConditionExplicit(user, true)).
111114
And("repository.owner_id <> ?", user.ID).

0 commit comments

Comments
 (0)