impl entities except for PATCH

This commit is contained in:
breel
2020-08-08 12:01:49 -06:00
parent 1655a9b83a
commit f88ade0d73
25 changed files with 195 additions and 33 deletions

View File

@@ -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, "/")

View File

@@ -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",
},