Skip to content

Commit 6604d4d

Browse files
openshift-cherrypick-robotGerry-FordeAndrienkoAleksandr
authored
[release-1.7] RHIDP-7572 - RBAC: Ability to add plugin(s) with permissions to the plugins configuration for the rbac-backend via the UI or API (#1386)
* 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: Gerry-Forde <[email protected]> Co-authored-by: Oleksandr Andriienko <[email protected]>
1 parent 6ce69d1 commit 6604d4d

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
@@ -39,9 +39,11 @@ permission:
3939
users:
4040
- name: user:default/__<your_policy_administrator_name>__
4141
----
42-
. 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].
42+
43+
. 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.
4344
+
44-
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:
45+
46+
.. To provide plugins by updating your application configuration, you can specify the plugins with permissions in your `{my-app-config-file}` file as follows:
4547
+
4648
.`{my-app-config-file}` fragment
4749
[source,yaml,subs=+quotes]
@@ -58,6 +60,8 @@ permission:
5860
- permission
5961
----
6062

63+
.. 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].
64+
6165
.Verification
6266
. Sign out from the existing {product} session and log in again using the declared policy administrator account.
6367
. 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
@@ -559,6 +559,86 @@ Returns permission policies for all static plugins.
559559
----
560560
--
561561

562+
[id='rbac-rest-api-permission-endpoints_{context}']
563+
[GET] /api/permission/plugins/id::
564+
+
565+
--
566+
Returns object with list plugin IDs:
567+
568+
.Example response (JSON)
569+
[source,json]
570+
----
571+
[
572+
{
573+
"ids": ["catalog", "permission"]
574+
}
575+
]
576+
----
577+
--
578+
579+
[POST] /api/permission/plugins/id::
580+
+
581+
--
582+
Add more plugins IDs defined in the request object.
583+
584+
Request Parameters: object in JSON format.
585+
586+
.Example request body (JSON)
587+
[source,json]
588+
----
589+
[
590+
{
591+
"ids": ["scaffolder"]
592+
}
593+
]
594+
----
595+
596+
Returns a status code of 200 and JSON with actual object stored in the server:
597+
598+
.Example response (JSON)
599+
[source,json]
600+
----
601+
[
602+
{
603+
"ids": ["catalog", "permission", "scaffolder"]
604+
}
605+
]
606+
----
607+
--
608+
609+
[DELETE] /api/permission/plugins/id::
610+
+
611+
--
612+
Delete plugins IDs defined in the request object.
613+
614+
Request Parameters: object in JSON format.
615+
616+
.Example request body (JSON)
617+
[source,json]
618+
----
619+
[
620+
{
621+
"ids": ["scaffolder"]
622+
}
623+
]
624+
----
625+
626+
Returns a status code of 200 and JSON with actual object stored in the server:
627+
628+
.Example response (JSON)
629+
[source,json]
630+
----
631+
[
632+
{
633+
"ids": ["catalog", "permission"]
634+
}
635+
]
636+
----
637+
--
638+
639+
[NOTE]
640+
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.
641+
562642
== Conditional policies
563643

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

0 commit comments

Comments
 (0)