1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-09 02:59:19 +00:00

Put in stubs for dynamic access control on schemas

This commit is contained in:
Darren Shepherd
2018-01-16 18:03:35 -07:00
parent f7f989c4e2
commit 245c089cd5
8 changed files with 66 additions and 30 deletions

View File

@@ -18,11 +18,11 @@ func (*AllAccess) CanList(apiContext *types.APIContext, schema *types.Schema) bo
return slice.ContainsString(schema.CollectionMethods, http.MethodGet)
}
func (*AllAccess) CanUpdate(apiContext *types.APIContext, schema *types.Schema) bool {
func (*AllAccess) CanUpdate(apiContext *types.APIContext, obj map[string]interface{}, schema *types.Schema) bool {
return slice.ContainsString(schema.ResourceMethods, http.MethodPut)
}
func (*AllAccess) CanDelete(apiContext *types.APIContext, schema *types.Schema) bool {
func (*AllAccess) CanDelete(apiContext *types.APIContext, obj map[string]interface{}, schema *types.Schema) bool {
return slice.ContainsString(schema.ResourceMethods, http.MethodDelete)
}