mirror of
https://github.com/rancher/norman.git
synced 2025-09-13 13:50:16 +00:00
More initial dev
This commit is contained in:
28
authorization/all.go
Normal file
28
authorization/all.go
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user