mirror of
https://github.com/rancher/norman.git
synced 2025-07-05 19:47:42 +00:00
29 lines
466 B
Go
29 lines
466 B
Go
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
|
|
}
|