Skip to content

Commit 26bdea4

Browse files
committed
modify demo navigation strings; update document
1 parent 1ffbf9b commit 26bdea4

File tree

2 files changed

+39
-9
lines changed

2 files changed

+39
-9
lines changed

demo/apps/settings.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ INSTALLED_APPS = [
2525
[MENUS]
2626
MAINMENU = {
2727
'subs':[
28-
{'name': 'apijson', 'link':'/', 'title':u'APIJSON Demo'},
29-
{'name': 'tables', 'link':'/tables', 'title':u'APIJSON tables'},
28+
{'name': 'apijson', 'link':'/', 'title':u'requests demo'},
29+
{'name': 'tables', 'link':'/tables', 'title':u'tables'},
3030
]
3131
}
3232

3333
[LAYOUT]
34-
logo_lg = "Uliweb"
34+
logo_lg = "uliweb-apijson"
3535
logo_mini = "U"
3636

3737
[SESSION]

uliweb_apijson/apijson/README.md

+36-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
uliweb-apijson is a subset and slightly different variation of [apijson](https://github.com/TommyLemon/APIJSON/blob/master/Document.md)
44

5-
# uliweb model configuration
5+
# apijson model configuration
66

77
## example
88

@@ -11,21 +11,51 @@ uliweb-apijson is a subset and slightly different variation of [apijson](https:/
1111
user = {
1212
"user_id_field" : "id",
1313
"secret_fields" : ["password"],
14-
"rbac_get" : {
15-
"roles" : ["ADMIN","OWNER"]
16-
}
14+
"GET" : { "roles" : ["ADMIN","OWNER"] },
15+
"HEAD" : { "roles" : ["ADMIN","OWNER"] },
16+
"POST" : { "roles" : ["ADMIN","OWNER"] },
17+
"PUT" : { "roles" : ["ADMIN","OWNER"] },
18+
"DELETE" : { "roles" : ["ADMIN","OWNER"] },
1719
}
1820
```
1921

2022
## document
2123

22-
settings.APIJSON_MODEL_CONFIG.[MODEL_NAME]
24+
settings.APIJSON_MODELS.[MODEL_NAME]
2325

2426
| Field | Doc |
2527
| ------------- | ---------------------------------------------------------- |
2628
| user_id_field | Field name of user id, related to query user own data. |
2729
| secret_fields | Secret fields won't be exposed. |
28-
| rbac_get | Configure of roles or permissions for apijson 'get' method |
30+
| GET/HEAD/POST/PUT/DELETE | Configure of roles or permissions for apijson methods |
31+
32+
# apijson request configuration
33+
34+
## example
35+
36+
```
37+
[APIJSON_REQUESTS]
38+
moment = {
39+
"moment": {
40+
"POST" :{
41+
"ADD":{"@role": "OWNER"},
42+
"DISALLOW" : ["id"],
43+
"NECESSARY" : ["content"],
44+
},
45+
"PUT" :{
46+
"ADD":{"@role": "OWNER"},
47+
"NECESSARY" : ["id","content"],
48+
},
49+
}
50+
}
51+
```
52+
## document
53+
54+
settings.APIJSON_REQUESTS.[TAG_NAME]
55+
56+
request types currently support: POST, PUT
57+
request configuration currently support: ADD,DISALLOW,NECESSARY (still not fully support [all the configuration items](https://github.com/TommyLemon/APIJSON/wiki#%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86))
58+
2959

3060
# Supported API Examples
3161

0 commit comments

Comments
 (0)