1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-12 04:29:33 +00:00

Distinguish between listing and getting

We now have resources (subtypes of authConfig) that can be retrieved
by ID but their collections are not viewable. This change is needed
to suppport that.
This commit is contained in:
Craig Jellick
2018-01-31 19:14:35 -07:00
parent 536d36c706
commit 65807e9372
5 changed files with 24 additions and 6 deletions

View File

@@ -14,6 +14,10 @@ func (*AllAccess) CanCreate(apiContext *types.APIContext, schema *types.Schema)
return slice.ContainsString(schema.CollectionMethods, http.MethodPost)
}
func (*AllAccess) CanGet(apiContext *types.APIContext, schema *types.Schema) bool {
return slice.ContainsString(schema.ResourceMethods, http.MethodGet)
}
func (*AllAccess) CanList(apiContext *types.APIContext, schema *types.Schema) bool {
return slice.ContainsString(schema.CollectionMethods, http.MethodGet)
}