impl entities except for PATCH
This commit is contained in:
@@ -46,7 +46,7 @@ func (s *Scope) fromToken(r *http.Request) bool {
|
||||
}
|
||||
|
||||
func (s *Scope) fromPath(path string) bool {
|
||||
if !strings.HasPrefix(path, "/entity/") {
|
||||
if !strings.HasPrefix(path, "/entities/") {
|
||||
return false
|
||||
}
|
||||
paths := strings.Split(path, "/")
|
||||
|
||||
@@ -56,29 +56,29 @@ func TestScopeFromPath(t *testing.T) {
|
||||
ok bool
|
||||
id string
|
||||
}{
|
||||
"/": {},
|
||||
"/hello": {},
|
||||
"/hello/": {},
|
||||
"/hello/entity": {},
|
||||
"/entity": {},
|
||||
"/entity/": {},
|
||||
"/entity/id": {
|
||||
"/": {},
|
||||
"/hello": {},
|
||||
"/hello/": {},
|
||||
"/hello/entities": {},
|
||||
"/entities": {},
|
||||
"/entities/": {},
|
||||
"/entities/id": {
|
||||
ok: true,
|
||||
id: "id",
|
||||
},
|
||||
"/entity/id/": {
|
||||
"/entities/id/": {
|
||||
ok: true,
|
||||
id: "id",
|
||||
},
|
||||
"/entity/id/excess": {
|
||||
"/entities/id/excess": {
|
||||
ok: true,
|
||||
id: "id",
|
||||
},
|
||||
"/entity/id#excess": {
|
||||
"/entities/id#excess": {
|
||||
ok: true,
|
||||
id: "id",
|
||||
},
|
||||
"/entity/id?excess": {
|
||||
"/entities/id?excess": {
|
||||
ok: true,
|
||||
id: "id",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user