Skip to content

Commit 993cf83

Browse files
committed
updated permission.md
1 parent e11eea0 commit 993cf83

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

Cpp/odin-views/permission.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,36 @@ This view is used when different HTTP verbs require different permissions.
3838
"allowed": "example-view",
3939
"forbidden": "read-only-view"
4040
},
41+
"otherwise": {
42+
"view": "fost.response.403"
43+
}
44+
}
45+
}
46+
```
47+
48+
`HEAD` is supported automatically if `GET` is configured and will use `GET` permission configuration.
49+
50+
The default view configuration for forbidden is `fost.response.403`.
51+
52+
`otherwise` configuration needs to be a proper view configuration. The default configuration for `otherwise` is shown below where `allow` is taken from all the verbs configured.
53+
54+
```json
55+
{
56+
"view": "odin.permission.method",
57+
"configuration": {
58+
"OPTIONS": "example.view",
59+
"GET": {
60+
"permission": "permission1-name",
61+
"allowed": "example-view"
62+
},
63+
"PUT": {
64+
"permission": "permission2-name",
65+
"allowed": "example-view",
66+
},
4167
"otherwise": {
4268
"view": "fost.response.405",
4369
"configuration": {
44-
"verbs": ["GET", "HEAD", "OPTIONS", "PUT"]
70+
"allow": ["GET", "HEAD", "OPTIONS", "PUT"]
4571
}
4672
}
4773
}

0 commit comments

Comments
 (0)