Skip to content

Commit 22ccef4

Browse files
RHIDP-7572 - RBAC: Ability to add plugin(s) with permissions to the plugins configuration for the rbac-backend via the UI or API (#1378)
* RHIDP-7572 - RBAC: Ability to add plugin(s) with permissions to the plugins configuration for the rbac-backend via the UI or API * Update modules/authorization/proc-enabling-the-rbac-plugin.adoc Co-authored-by: Oleksandr Andriienko <[email protected]> --------- Co-authored-by: Oleksandr Andriienko <[email protected]>
1 parent e411bc8 commit 22ccef4

File tree

2 files changed

+86
-2
lines changed

2 files changed

+86
-2
lines changed

modules/authorization/proc-enabling-the-rbac-plugin.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ permission:
4141
users:
4242
- name: user:default/__<your_policy_administrator_name>__
4343
----
44-
. In order for the {product-short} Web UI to display available permissions provided by installed plugins, add the corresponding plugin IDs to {configuring-book-link}[your custom `{my-app-config-file}` {product-short} configuration file].
44+
45+
. In order to display the available permissions provided by installed plugins in the {product-short} UI, you must supply the corresponding list of plugin IDs. There are two ways to do this, by updating your application configuration or by using the RBAC REST API permissions endpoint.
4546
+
46-
To display available permissions in RBAC UI, edit your custom {product-short} ConfigMap, such as `app-config-rhdh`, and add following code to the `{my-app-config-file}` content:
47+
48+
.. To provide plugins by updating your application configuration, you can specify the plugins with permissions in your `{my-app-config-file}` file as follows:
4749
+
4850
.`{my-app-config-file}` fragment
4951
[source,yaml,subs=+quotes]
@@ -60,6 +62,8 @@ permission:
6062
- permission
6163
----
6264

65+
.. To specify the plugins with permissions by using the RBAC REST API permissions endpoint, see the xref:rbac-rest-api-permission-endpoints_{context}[RBAC REST API permissions endpoint].
66+
6367
.Verification
6468
. Sign out from the existing {product} session and log in again using the declared policy administrator account.
6569
. With RBAC enabled, most features are disabled by default.

modules/authorization/ref-rbac-rest-api-endpoints.adoc

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,86 @@ Returns permission policies for all static plugins.
561561
----
562562
--
563563

564+
[id='rbac-rest-api-permission-endpoints_{context}']
565+
[GET] /api/permission/plugins/id::
566+
+
567+
--
568+
Returns object with list plugin IDs:
569+
570+
.Example response (JSON)
571+
[source,json]
572+
----
573+
[
574+
{
575+
"ids": ["catalog", "permission"]
576+
}
577+
]
578+
----
579+
--
580+
581+
[POST] /api/permission/plugins/id::
582+
+
583+
--
584+
Add more plugins IDs defined in the request object.
585+
586+
Request Parameters: object in JSON format.
587+
588+
.Example request body (JSON)
589+
[source,json]
590+
----
591+
[
592+
{
593+
"ids": ["scaffolder"]
594+
}
595+
]
596+
----
597+
598+
Returns a status code of 200 and JSON with actual object stored in the server:
599+
600+
.Example response (JSON)
601+
[source,json]
602+
----
603+
[
604+
{
605+
"ids": ["catalog", "permission", "scaffolder"]
606+
}
607+
]
608+
----
609+
--
610+
611+
[DELETE] /api/permission/plugins/id::
612+
+
613+
--
614+
Delete plugins IDs defined in the request object.
615+
616+
Request Parameters: object in JSON format.
617+
618+
.Example request body (JSON)
619+
[source,json]
620+
----
621+
[
622+
{
623+
"ids": ["scaffolder"]
624+
}
625+
]
626+
----
627+
628+
Returns a status code of 200 and JSON with actual object stored in the server:
629+
630+
.Example response (JSON)
631+
[source,json]
632+
----
633+
[
634+
{
635+
"ids": ["catalog", "permission"]
636+
}
637+
]
638+
----
639+
--
640+
641+
[NOTE]
642+
In order to prevent an inconsistent state after a deployment restart, the REST API does not allow deletion of plugin IDs that were provided by using the application configuration. These ID values can only be removed through the configuration file.
643+
564644
== Conditional policies
565645

566646
The RBAC REST API supports the following endpoints for managing conditional policies in the {product}.

0 commit comments

Comments
 (0)