From 87712235de4d056c40ab6fa3cd1d4b616b6a8de8 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 17 Nov 2022 14:35:09 -0500 Subject: [PATCH] fix(server): don't list unauthorized repos --- server/cmd/list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/cmd/list.go b/server/cmd/list.go index e1b239b186f8d453fbbc810efa4b3c07d630f4b8..ff4045c5b1f8a3fbbe6c2f6ca8eea42e928c7f34 100644 --- a/server/cmd/list.go +++ b/server/cmd/list.go @@ -33,7 +33,9 @@ func ListCommand() *cobra.Command { } if path == "" || path == "." || path == "/" { for _, r := range ac.Source.AllRepos() { - fmt.Fprintln(s, r.Repo()) + if ac.AuthRepo(r.Repo(), s.PublicKey()) >= gitwish.ReadOnlyAccess { + fmt.Fprintln(s, r.Repo()) + } } return nil }