Commit a636454
[Spaces] API endpoint for roles which have access to a given space (#181165)
## Summary
Added endpoint `GET kbn:/internal/security/roles/{space-id}` to get all
roles for provided space id.
**Note**: changes needed for application `*` privileges were
cherry-picked [to a separate
PR].(#181400)
## Example
Request `GET kbn:/internal/security/roles/space-b`
Response
```
[
{
"name": "role-a",
"metadata": {},
"transient_metadata": {
"enabled": true
},
"elasticsearch": {
"cluster": [
"all"
],
"indices": [],
"run_as": []
},
"kibana": [
{
"base": [],
"feature": {
"dev_tools": [
"all"
]
},
"spaces": [
"default",
"space-b"
]
}
],
"_transform_error": [],
"_unrecognized_applications": []
},
{
"name": "superuser",
"metadata": {
"_reserved": true
},
"transient_metadata": {},
"elasticsearch": {
"cluster": [
"all"
],
"indices": [
{
"names": [
"*"
],
"privileges": [
"all"
],
"allow_restricted_indices": false
},
{
"names": [
"*"
],
"privileges": [
"monitor",
"read",
"view_index_metadata",
"read_cross_cluster"
],
"allow_restricted_indices": true
}
],
"remote_indices": [
{
"names": [
"*"
],
"privileges": [
"all"
],
"allow_restricted_indices": false,
"clusters": [
"*"
]
},
{
"names": [
"*"
],
"privileges": [
"monitor",
"read",
"view_index_metadata",
"read_cross_cluster"
],
"allow_restricted_indices": true,
"clusters": [
"*"
]
}
],
"run_as": [
"*"
]
},
"kibana": [
{
"base": [
"all"
],
"feature": {},
"spaces": [
"*"
]
}
],
"_transform_error": [],
"_unrecognized_applications": [
"*"
]
}
]
```
### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### For maintainers
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
__Fixes: https://github.com/elastic/kibana/issues/180718__
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>1 parent f5d7eb6 commit a636454
10 files changed
Lines changed: 506 additions & 14 deletions
File tree
- x-pack
- plugins/security/server
- authorization
- privileges
- roles
- routes/authorization/roles
- test/api_integration/apis/security
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| 510 | + | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
| |||
574 | 576 | | |
575 | 577 | | |
576 | 578 | | |
| 579 | + | |
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| |||
643 | 646 | | |
644 | 647 | | |
645 | 648 | | |
| 649 | + | |
646 | 650 | | |
647 | 651 | | |
648 | 652 | | |
| |||
910 | 914 | | |
911 | 915 | | |
912 | 916 | | |
| 917 | + | |
913 | 918 | | |
914 | 919 | | |
915 | 920 | | |
| |||
1068 | 1073 | | |
1069 | 1074 | | |
1070 | 1075 | | |
| 1076 | + | |
1071 | 1077 | | |
1072 | 1078 | | |
1073 | 1079 | | |
| |||
1303 | 1309 | | |
1304 | 1310 | | |
1305 | 1311 | | |
| 1312 | + | |
1306 | 1313 | | |
1307 | 1314 | | |
1308 | 1315 | | |
| |||
1441 | 1448 | | |
1442 | 1449 | | |
1443 | 1450 | | |
| 1451 | + | |
1444 | 1452 | | |
1445 | 1453 | | |
1446 | 1454 | | |
| |||
1619 | 1627 | | |
1620 | 1628 | | |
1621 | 1629 | | |
| 1630 | + | |
1622 | 1631 | | |
1623 | 1632 | | |
1624 | 1633 | | |
| |||
1755 | 1764 | | |
1756 | 1765 | | |
1757 | 1766 | | |
| 1767 | + | |
1758 | 1768 | | |
1759 | 1769 | | |
1760 | 1770 | | |
| |||
1969 | 1979 | | |
1970 | 1980 | | |
1971 | 1981 | | |
| 1982 | + | |
1972 | 1983 | | |
1973 | 1984 | | |
1974 | 1985 | | |
| |||
2202 | 2213 | | |
2203 | 2214 | | |
2204 | 2215 | | |
| 2216 | + | |
2205 | 2217 | | |
2206 | 2218 | | |
2207 | 2219 | | |
| |||
2471 | 2483 | | |
2472 | 2484 | | |
2473 | 2485 | | |
| 2486 | + | |
2474 | 2487 | | |
2475 | 2488 | | |
2476 | 2489 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
Lines changed: 2 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 48 | + | |
59 | 49 | | |
60 | 50 | | |
61 | 51 | | |
| |||
0 commit comments