Don't drop schemas that have existing authorization

This commit is contained in:
Darren Shepherd 2020-10-22 17:03:41 -07:00
parent c84c1b52af
commit 12b7626eda

View File

@ -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
}