diff --git a/endpoints/api/repository.py b/endpoints/api/repository.py index 74c135b60..13d32a3fc 100644 --- a/endpoints/api/repository.py +++ b/endpoints/api/repository.py @@ -133,7 +133,8 @@ class RepositoryList(ApiResource): namespace=args['namespace']) response['repositories'] = [repo_view(repo) for repo in repo_query - if ReadRepositoryPermission(repo.namespace, repo.name).can()] + if (repo.visibility.name == 'public' or + ReadRepositoryPermission(repo.namespace, repo.name).can())] return response diff --git a/endpoints/api/search.py b/endpoints/api/search.py index 0736bb632..2d96b0384 100644 --- a/endpoints/api/search.py +++ b/endpoints/api/search.py @@ -111,5 +111,6 @@ class FindRepositories(ApiResource): matching = model.get_matching_repositories(prefix, username) return { 'repositories': [repo_view(repo) for repo in matching - if ReadRepositoryPermission(repo.namespace, repo.name).can()] + if (repo.visibility.name == 'public' or + ReadRepositoryPermission(repo.namespace, repo.name).can())] } \ No newline at end of file