Commit d1c156a
committed
MB-38322 GET /_uiroles REST API
called without parameters
returns the following json:
{"folders": [....],
"parameters": {....}}
value of folders key is an array of maps:
{
"name": <name of folder>,
"roles": [....]
}
roles array contains roles that belong to the folder in the
following format
{"role": <role>,
"params": <array of role parameters>,
"name": <name of the role to show in UI>,
"desc": <description of the role>}
value of the key "parameters" is a tree structure representing
all possible parameter values
Here's how UI should enumerate all possible parameters:
Let's say the role has parameters [bucket_name, scope_name,
collection_name]
1. UI code should look in the "parameters" map for "bucket_name"
and retrieve an array of the following structures:
{"value": <bucket name>, "children": <optional map of child parameters>}
2. If "children" is specified, UI code should look for the second
parameter "scope_name" in the map and so on..
It is implied that each parameter can also be a wildcard, therefore
wildcards are not returned by the API.
Example of output:
{
"folders": [
{
"name": "Administrative Roles",
"roles": [
{
"role": "admin",
"params": [],
"name": "Full Admin",
"desc": "Can manage all cluster features..."
},
..................
{
"name": "Data Service",
"roles": [
{
"role": "data_reader",
"params": [
"bucket_name",
"scope_name",
"collection_name"
],
"name": "Data Reader",
"desc": "Can read data from a given bucket, scope..."
},
..................
{
"name": "Views",
"roles": [
{
"role": "views_admin",
"params": [
"bucket_name"
],
"name": "Views Admin",
"desc": "Can create and manage views of a given..."
}
]
},
-------------
"parameters": {
"bucket_name": [
{
"value": "test",
"children": {
"scope_name": [
{
"value": "_default",
"children": {
"collection_name": [
{
"value": "_default"
}
]
}
}
]
}
}
]
}
}
Change-Id: I8341456851efb93a52e85bb05b25cb1152fcfa4f
Reviewed-on: http://review.couchbase.org/c/ns_server/+/129449
Tested-by: Artem Stemkovski <artem@couchbase.com>
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Timofey Barmin <timofey.barmin@couchbase.com>1 parent c3d6ea5 commit d1c156a
File tree
4 files changed
+92
-13
lines changed- src
4 files changed
+92
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
953 | 954 | | |
954 | 955 | | |
955 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
956 | 962 | | |
957 | 963 | | |
958 | 964 | | |
959 | 965 | | |
960 | | - | |
961 | | - | |
962 | | - | |
| 966 | + | |
963 | 967 | | |
964 | 968 | | |
965 | 969 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
192 | 202 | | |
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
1677 | 1682 | | |
1678 | 1683 | | |
1679 | 1684 | | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1680 | 1751 | | |
1681 | 1752 | | |
1682 | 1753 | | |
| |||
0 commit comments