Skip to content

Commit 12981eb

Browse files
authored
Merge pull request #51686 from shipsing/RHDEVDOCS-4280
RHDEVDOCS-4280: Added a procedure to customize the user perspective
2 parents a180d26 + d9b718c commit 12981eb

5 files changed

+136
-0
lines changed
23.1 KB
Loading
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Module included in the following assembly:
2+
//
3+
// * web_console/customizing-the-web-console.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="odc-customizing-a-perspective-using-YAML-view_{context}"]
7+
= Customizing a perspective using YAML view
8+
9+
.Prerequisites
10+
* You must have administrator privileges.
11+
12+
.Procedure
13+
. In the *Administrator* perspective, navigate to *Administration* -> *Cluster Settings*.
14+
. Select the *Configuration* tab and click the *Console (operator.openshift.io)* resource.
15+
. Click the *YAML* tab and make your customization:
16+
.. To enable or disable a perspective, insert the snippet for *Add user perspectives* and edit the YAML code as needed:
17+
+
18+
[source,yaml]
19+
----
20+
apiVersion: operator.openshift.io/v1
21+
kind: Console
22+
metadata:
23+
name: cluster
24+
spec:
25+
customization:
26+
perspectives:
27+
- id: admin
28+
visibility:
29+
state: Enabled
30+
- id: dev
31+
visibility:
32+
state: Enabled
33+
----
34+
.. To hide a perspective based on RBAC permissions, insert the snippet for *Hide user perspectives* and edit the YAML code as needed:
35+
+
36+
[source,yaml]
37+
----
38+
apiVersion: operator.openshift.io/v1
39+
kind: Console
40+
metadata:
41+
name: cluster
42+
spec:
43+
customization:
44+
perspectives:
45+
- id: admin
46+
requiresAccessReview:
47+
- group: rbac.authorization.k8s.io
48+
resource: clusterroles
49+
verb: list
50+
- id: dev
51+
state: Enabled
52+
----
53+
.. To customize a perspective based on your needs, create your own YAML snippet:
54+
+
55+
[source,yaml]
56+
----
57+
apiVersion: operator.openshift.io/v1
58+
kind: Console
59+
metadata:
60+
name: cluster
61+
spec:
62+
customization:
63+
perspectives:
64+
- id: admin
65+
visibility:
66+
state: AccessReview
67+
accessReview:
68+
missing:
69+
- resource: deployment
70+
verb: list
71+
required:
72+
- resource: namespaces
73+
verb: list
74+
- id: dev
75+
visibility:
76+
state: Enabled
77+
----
78+
79+
. Click *Save*.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assembly:
2+
//
3+
// * web_console/customizing-the-web-console.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="odc-customizing-a-perspective-using-form-view_{context}"]
7+
= Customizing a perspective using form view
8+
9+
.Prerequisites
10+
* You must have administrator privileges.
11+
12+
.Procedure
13+
. In the *Administrator* perspective, navigate to *Administration* -> *Cluster Settings*.
14+
. Select the *Configuration* tab and click the *Console (operator.openshift.io)* resource.
15+
. Click *Actions* -> *Customize* on the right side of the page.
16+
. In the *General* settings, customize the perspective by selecting one of the following options from the dropdown list:
17+
* *Enabled*: Enables the perspective for all users
18+
* *Only visible for privileged users*: Enables the perspective for users who can list all namespaces
19+
* *Only visible for unprivileged users*: Enables the perspective for users who cannot list all namespaces
20+
* *Disabled*: Disables the perspective for all users
21+
+
22+
A notification opens to confirm that your changes are saved.
23+
+
24+
image::customizing-user-perspective.png[]
25+
+
26+
[NOTE]
27+
====
28+
When you customize the user perspective, your changes are automatically saved and take effect after a browser refresh.
29+
====
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Module included in the following assembly:
2+
//
3+
// * web_console/customizing-the-web-console.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="odc-customizing-user-perspectives_{context}"]
7+
= Customizing user perspectives
8+
9+
The {product-title} web console provides two perspectives by default, *Administrator* and *Developer*. You might have more perspectives available depending on installed console plug-ins. As a cluster administrator, you can show or hide a perspective for all users or for a specific user role. Customizing perspectives ensures that users can view only the perspectives that are applicable to their role and tasks. For example, you can hide the *Administrator* perspective from unprivileged users so that they cannot manage cluster resources, users, and projects. Similarly, you can show the *Developer* perspective to users with the developer role so that they can create, deploy, and monitor applications.
10+
11+
You can also customize the perspective visibility for users based on role-based access control (RBAC). For example, if you customize a perspective for monitoring purposes, which requires specific permissions, you can define that the perspective is visible only to users with required permissions.
12+
13+
Each perspective includes the following mandatory parameters, which you can edit in the YAML view:
14+
15+
* `id`: Defines the ID of the perspective to show or hide
16+
* `visibility`: Defines the state of the perspective along with access review checks, if needed
17+
* `state`: Defines whether the perspective is enabled, disabled, or needs an access review check
18+
19+
[NOTE]
20+
====
21+
By default, all perspectives are enabled. When you customize the user perspective, your changes are applicable to the entire cluster.
22+
====

web_console/customizing-the-web-console.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ include::modules/adding-custom-notification-banners.adoc[leveloffset=+1]
2626
include::modules/customizing-cli-downloads.adoc[leveloffset=+1]
2727

2828
include::modules/adding-yaml-examples-to-kube-resources.adoc[leveloffset=+1]
29+
30+
include::modules/odc-customizing-user-perspectives.adoc[leveloffset=+1]
31+
32+
include::modules/odc-customizing-a-perspective-using-YAML-view.adoc[leveloffset=+2]
33+
34+
include::modules/odc-customizing-a-perspective-using-form-view.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)