From 12b7626eda71154f256cfe35112f378b0fdcf471 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 22 Oct 2020 17:03:41 -0700 Subject: [PATCH] Don't drop schemas that have existing authorization --- pkg/schema/factory.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/schema/factory.go b/pkg/schema/factory.go index 7c106b2..c06a727 100644 --- a/pkg/schema/factory.go +++ b/pkg/schema/factory.go @@ -96,8 +96,6 @@ func (c *Collection) schemasForSubject(access *accesscontrol.AccessSet) (*types. // always allow list s.CollectionMethods = append(s.CollectionMethods, http.MethodGet) } - } else { - continue } } @@ -118,6 +116,10 @@ func (c *Collection) schemasForSubject(access *accesscontrol.AccessSet) (*types. s.CollectionMethods = append(s.CollectionMethods, http.MethodPost) } + if len(s.CollectionMethods) == 0 && len(s.ResourceMethods) == 0 { + continue + } + if err := result.AddSchema(*s); err != nil { return nil, err }