internal/service/repo_service.go
+4
-1
| @@ -18,7 +18,10 @@ func (s *RepoService) Get(ctx context.Context, owner, name string) (*model.Repository, error) { | |||
| 18 | 18 | repo, err := s.stores.Repos.GetByOwnerAndName(ctx, owner, name) | |
| 19 | 19 | if err != nil { | |
| 20 | 20 | return nil, err | |
| 21 | 21 | } | |
| 22 | - | return repo, nil | |
| 22 | + | if repo.IsPrivate && !s.canRead(ctx, repo) { | |
| 23 | + | return nil, ErrNotFound | |
| 24 | + | } | |
| 25 | + | return repo, nil | |
| 23 | 26 | } | |
| 24 | 27 | ||
| 25 | 28 | func (s *RepoService) List(ctx context.Context, owner string) ([]model.Repository, error) { | |