1
0
mirror of https://github.com/rancher/norman.git synced 2025-07-01 09:42:06 +00:00
norman/authorization/all.go

29 lines
466 B
Go
Raw Normal View History

2017-11-11 04:44:02 +00:00
package authorization
import (
"net/http"
"github.com/rancher/norman/types"
)
type AllAccess struct {
}
func (*AllAccess) CanCreate(schema *types.Schema) bool {
for _, method := range schema.CollectionMethods {
if method == http.MethodPost {
return true
}
}
return false
}
func (*AllAccess) CanList(schema *types.Schema) bool {
for _, method := range schema.CollectionMethods {
if method == http.MethodGet {
return true
}
}
return false
}