1
0
mirror of https://github.com/quay/quay.git synced 2025-07-28 20:22:05 +03:00

api: adding global readonly user to list repo endpoint (PROJQUAY-7446) (#3072)

Adding global readonly user to list repo endpoint.
This commit is contained in:
Brandon Caton
2024-07-25 11:18:34 -04:00
committed by GitHub
parent b78a746426
commit ec64325edd
2 changed files with 23 additions and 2 deletions

View File

@ -2328,6 +2328,27 @@ class TestListRepos(ApiTestCase):
self.login(PUBLIC_USER)
self.assertRepositoryNotVisible("neworg", "somerepo")
def test_list_repos_globalreadonlysuperuser(self):
repository = model.repository.get_repository("orgwithnosuperuser", "repo")
assert repository is not None
assert repository.visibility.name == "private"
self.login("globalreadonlysuperuser")
json = self.getJsonResponse(
RepositoryList,
params=dict(namespace="orgwithnosuperuser", public=False),
)
assert len(json["repositories"]) == 1
assert json["repositories"][0]["name"] == "repo"
# Make sure a normal user can't see the repository
self.login(NO_ACCESS_USER)
json = self.getJsonResponse(
RepositoryList,
params=dict(namespace="orgwithnosuperuser", public=False),
)
assert len(json["repositories"]) == 0
class TestViewPublicRepository(ApiTestCase):
def test_normalview(self):