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:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user