From cccff467157fe17f1084a47e34d0fd17d7b87c2b Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sun, 27 Nov 2016 04:02:58 +0900 Subject: [PATCH] (refs #1355)Fix RepositoryService#getVisibleRepositories() to contain group repositories --- .../scala/gitbucket/core/service/RepositoryService.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/scala/gitbucket/core/service/RepositoryService.scala b/src/main/scala/gitbucket/core/service/RepositoryService.scala index 11d6ba61d..7471b8ee3 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryService.scala @@ -279,7 +279,10 @@ trait RepositoryService { self: AccountService => // for Normal Users case Some(x) if(!x.isAdmin) => Repositories filter { t => (t.isPrivate === false.bind) || (t.userName === x.userName) || - (Collaborators.filter { t2 => t2.byRepository(t.userName, t.repositoryName) && (t2.collaboratorName === x.userName.bind)} exists) + (Collaborators.filter { t2 => + t2.byRepository(t.userName, t.repositoryName) && + (t2.collaboratorName === x.userName.bind) || (t2.collaboratorName in GroupMembers.filter(_.userName === x.userName.bind).map(_.groupName)) + } exists) } // for Guests case None => Repositories filter(_.isPrivate === false.bind)