summaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/access.go')
-rw-r--r--models/access.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/access.go b/models/access.go
index fa3642cf53..3c3655ead6 100644
--- a/models/access.go
+++ b/models/access.go
@@ -124,14 +124,18 @@ func (u *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error) {
// GetAccessibleRepositories finds repositories which the user has access but does not own.
// If limit is smaller than 1 means returns all found results.
func (user *User) GetAccessibleRepositories(limit int) (repos []*Repository, _ error) {
- sess := x.Where("owner_id !=? ", user.ID).Desc("updated_unix")
+ sess := x.
+ Where("owner_id !=? ", user.ID).
+ Desc("updated_unix")
if limit > 0 {
sess.Limit(limit)
repos = make([]*Repository, 0, limit)
} else {
repos = make([]*Repository, 0, 10)
}
- return repos, sess.Join("INNER", "access", "access.user_id = ? AND access.repo_id = repository.id", user.ID).Find(&repos)
+ return repos, sess.
+ Join("INNER", "access", "access.user_id = ? AND access.repo_id = repository.id", user.ID).
+ Find(&repos)
}
func maxAccessMode(modes ...AccessMode) AccessMode {