Fix public repository permissions checking.
This commit is contained in:
parent
4d2e090bea
commit
8fefe239b5
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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())]
|
||||
}
|
Reference in a new issue