Chapter 5. Managing access to projects
5.1. Custom roles for workbenches Copy linkLink copied to clipboard!
You can use custom roles to control fine-grained, resource-level permissions for workbenches within a project. With custom roles, project administrators can define exactly who can view, edit, start, stop, or delete specific workbench instances, going beyond the default Admin and Contributor permission levels.
5.1.1. Kubernetes RBAC foundations Copy linkLink copied to clipboard!
OpenShift AI custom roles build on the role-based access control (RBAC) model that is native to Kubernetes and OpenShift. In Kubernetes RBAC, access decisions are governed by three core objects:
- Role
-
A
Roledefines a set of permissions as rules. Each rule specifies an API group, a resource type, and the verbs that are allowed on that resource. ARoleis scoped to a single namespace, which maps to a single OpenShift AI project. AClusterRoleuses the same rules structure but is not namespace-scoped, allowing it to be reused across multiple projects. - RoleBinding
-
A
RoleBindinggrants the permissions defined in aRoleorClusterRoleto a user, a group, or a service account within a namespace. A single role can be bound to multiple subjects, and a single subject can have multipleRoleBindings. - Subject
-
A subject is the user, group, or service account to which a
RoleBindinggrants permissions.
By using these standard Kubernetes objects, OpenShift AI custom roles inherit the security, auditability, and extensibility of the platform’s existing access control framework. All permission changes are recorded by the Kubernetes API audit log, and roles integrate with your existing identity provider and group management without requiring a separate access control system.
5.1.2. Why fine-grained RBAC matters Copy linkLink copied to clipboard!
The default Admin and Contributor permission levels in OpenShift AI projects provide broad access to all project resources. In environments where multiple users or teams share a project, these broad permission levels can be insufficient:
- Least-privilege access
- Organizations with security or compliance requirements must ensure that users have only the minimum permissions required for their tasks. A data scientist who runs preconfigured workbenches should not have permission to delete or reconfigure them.
- Resource isolation
- In shared projects, administrators might need to prevent users from viewing or interacting with workbenches that are not assigned to them, protecting sensitive configurations and data connections.
- Operational safety
- Restricting destructive actions, such as deleting workbenches, to a small set of administrators reduces the risk of accidental data loss in production environments.
- Auditability
- Fine-grained roles produce more meaningful audit trails. When each user’s permissions are tightly scoped, audit logs clearly show which user had authorization to perform a specific action.
5.1.3. Workbenches and the Notebook custom resource Copy linkLink copied to clipboard!
In OpenShift AI, each workbench is represented by a Notebook custom resource in the kubeflow.org API group. When you create, start, stop, or delete a workbench in the OpenShift AI dashboard, the dashboard performs the corresponding Kubernetes API operation on the Notebook resource in the project namespace. Custom roles for workbenches define permissions against this Notebook resource, which means that Kubernetes RBAC rules control access to workbench operations at the API level.
5.1.4. How custom roles work Copy linkLink copied to clipboard!
Custom roles for workbenches are Kubernetes Role or ClusterRole objects that define permissions for Notebook resources. A Role applies to a single project namespace, while a ClusterRole can be reused across multiple projects. You create custom roles by using the oc CLI or by importing a YAML definition in the OpenShift web console. You then assign the roles to users or groups from the OpenShift AI dashboard.
To make a custom role visible in the OpenShift AI dashboard, you must apply the following label to the Role or ClusterRole object:
metadata:
labels:
opendatahub.io/dashboard: 'true'
Roles with this label appear in the dashboard’s role selection list with an AI role label in the Role type column, distinguishing them from default OpenShift roles such as Admin or Edit.
5.1.5. Example use cases Copy linkLink copied to clipboard!
The following examples illustrate how custom roles address common access control requirements:
- Workbench reader
- A user can view workbench configurations and status but cannot modify, start, or stop workbenches.
- Workbench operator
- A user can start and stop existing workbenches but cannot create new workbenches or edit their configurations.
- Workbench editor
- A user can create and modify workbenches but cannot delete them.
5.1.6. Scope and limitations Copy linkLink copied to clipboard!
- Custom roles apply to workbench resources only. Granular RBAC for other project resources such as pipelines, model servers, and data connections is planned for a future release.
-
You can only create and edit custom roles by using the
ocCLI or by importing YAML in the OpenShift web console. Creating or editing custom roles directly in the OpenShift AI dashboard is not supported. A dashboard interface for administrators to create and configure custom roles is planned for a future release. -
A custom role must have the
opendatahub.io/dashboard: 'true'label to display in the OpenShift AI dashboard. Roles without this label are not displayed. - You can assign multiple custom roles to a single user or group. The effective permissions are the union of all assigned roles.
5.2. Create a custom workbench role Copy linkLink copied to clipboard!
You can create a custom Kubernetes role that defines fine-grained permissions for workbench resources in a project by using the oc CLI or by importing a YAML definition in the OpenShift web console. After you apply the required label, the role becomes available for assignment in the OpenShift AI dashboard.
Creating or editing custom roles directly in the OpenShift AI dashboard is not supported. You must use the oc CLI or the OpenShift web console to create custom roles.
Prerequisites
-
You have
cluster-adminor project administrator privileges on the OpenShift cluster. -
You have access to the
ocCLI or the OpenShift web console.
Procedure
Define a
RoleorClusterRoleobject that specifies the permissions you want to grant for workbench resources. Use aRoleto scope permissions to a single project namespace, or use aClusterRoleto define a reusable role that can be assigned across multiple projects. Save the following YAML to a file, or prepare it for import in the OpenShift web console.The following example creates a namespace-scoped role that allows a user to view workbenches but not modify them:
apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: <role_name> namespace: <project_namespace> labels: opendatahub.io/dashboard: true rules: - apiGroups: - kubeflow.org resources: - notebooks verbs: - get - list - watchTo create a
ClusterRoleinstead, setkind: ClusterRoleand omit thenamespacefield:apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: <role_name> labels: opendatahub.io/dashboard: true rules: - apiGroups: - kubeflow.org resources: - notebooks verbs: - get - list - watchwhere:
_<role_name>_-
Specifies a descriptive name for the role, such as
workbench-readerorworkbench-operator. _<project_namespace>_-
Specifies the namespace of the OpenShift AI project where the role applies. This field is required for a
Roleand must be omitted for aClusterRole.
Create the role by using one of the following methods:
CLI: Apply the YAML file by running the following command:
$ oc apply -f <role_file>.yaml- OpenShift web console: In the web console, click the Import YAML icon (+) in the top navigation bar. Paste your YAML definition into the editor and click Create.
Verify that the role was created and that the required label is present:
$ oc get roles -n <project_namespace> <role_name> -o yamlConfirm that the
opendatahub.io/dashboard: 'true'label is output in themetadata.labelssection. This label is required for the role to display in the OpenShift AI dashboard.
Verification
- Log in to the OpenShift AI dashboard.
- Navigate to the Permissions tab of the project where you created the role.
- Click Manage Permissions and verify that your custom role appears in the role selection list with an AI role label in the Role type column.
Additional resources
- Section 5.7, “Custom workbench roles reference”
- Using RBAC to define and apply permissions in the OpenShift documentation
5.3. Grant access to a project Copy linkLink copied to clipboard!
To enable your organization to work collaboratively, you can grant access to your project to other users and groups.
Prerequisites
- You have logged in to Red Hat OpenShift AI.
- You have created a project.
Procedure
From the OpenShift AI dashboard, click Projects.
The Projects page opens.
From the list of projects, click the name of the project that you want to grant access to.
A project details page opens.
Click the Permissions tab.
The Permissions page for the project opens.
- Click Manage Permissions.
- From the Subject Kind list, select User or Group.
- In the search field, enter the name of the user or group to whom you want to grant access. If the subject is not present in the list, enter the name directly.
From the role selection list, select one of the following access permission levels:
- Admin: Subjects with this access level can edit project details and manage access to the project.
- Contributor: Subjects with this access level can view and edit project components, such as its workbenches, connections, and storage.
- Review the assignment summary in the confirmation dialog.
- Click Confirm to apply the access permissions.
- Optional: To grant access to additional users or groups, repeat this process.
Verification
- Users to whom you provided access to the project can perform only the actions permitted by their access permission level.
- The Permissions tab shows the users and groups that you granted access to and their assigned roles.
5.4. Assign custom roles to project users Copy linkLink copied to clipboard!
As a project administrator, you can assign custom roles to users and groups from the Permissions tab in the OpenShift AI dashboard. Custom roles provide fine-grained, resource-level permissions for workbenches within a project.
Prerequisites
- You have logged in to Red Hat OpenShift AI.
- You have OpenShift AI administrator privileges or you are the project owner.
- You have created a project.
-
One or more custom roles with the
opendatahub.io/dashboard: 'true'label exist in the project namespace. For more information, see Section 5.2, “Create a custom workbench role”.
Procedure
From the OpenShift AI dashboard, click Projects.
The Projects page opens.
Click the name of the project in which you want to assign custom roles.
A project details page opens.
Click the Permissions tab.
The Permissions page for the project opens.
- Click Manage Permissions.
- From the Subject Kind list, select User or Group.
- In the search field, enter the name of the user or group to whom you want to assign a role. If the subject is not present in the list, enter the name directly.
From the role selection list, select the custom role to assign. The dashboard displays roles that have the
opendatahub.io/dashboard: 'true'label with an AI role label in the Role type column, distinguishing them from default OpenShift roles.NoteYou can select multiple roles simultaneously for a single subject. The effective permissions are the union of all assigned roles.
- Review the role assignment summary in the confirmation dialog.
- Click Confirm to apply the role assignments.
Verification
- The Permissions tab shows the custom roles assigned to each user and group.
- Users with assigned custom roles can perform only the actions permitted by their roles.
5.5. Update access to a project Copy linkLink copied to clipboard!
To change the level of collaboration on your project, you can update the access permissions of users and groups who have access to your project. You can manage permissions from the action menu on individual role assignments or by using the Manage Permissions flow.
Prerequisites
- You have logged in to Red Hat OpenShift AI.
- You have OpenShift AI administrator privileges or you are the project owner.
- You have created a project.
- You have previously assigned roles to users or groups in your project.
Procedure
From the OpenShift AI dashboard, click Projects.
The Projects page opens.
Click the name of the project that you want to change the access permissions of.
A project details page opens.
Click the Permissions tab.
The Permissions page for the project opens. Each row shows an individual role assignment for a user or group.
- Locate the role assignment that you want to update and click the action menu (⋮).
Click Manage permissions.
The Manage Permissions dialog opens.
- From the role selection list, select the updated access permission level or custom role for the subject.
- Review the updated assignment summary in the confirmation dialog.
- Click Confirm to apply the updated access permissions.
Verification
- The Permissions tab shows the updated roles assigned to the users and groups whose access permissions you changed.
5.6. Remove access to a project Copy linkLink copied to clipboard!
You can restrict access to your project by unassigning roles from users and groups. Each role assignment is listed as a separate row on the Permissions tab, and you can unassign roles individually.
Prerequisites
- You have logged in to Red Hat OpenShift AI.
- You have OpenShift AI administrator privileges or you are the project owner.
- You have created a project.
- You have previously assigned roles to users or groups in your project.
Procedure
From the OpenShift AI dashboard, click Projects.
The Projects page opens.
Click the name of the project that you want to change the access permissions of.
A project details page opens.
Click the Permissions tab.
The Permissions page for the project opens. Each row shows an individual role assignment for a user or group.
- Locate the role assignment that you want to remove and click the action menu (⋮).
Click Unassign.
The Unassign role? dialog opens and warns that the user or group will lose the permissions that this role grants.
NoteIf the role was assigned through OpenShift rather than through the OpenShift AI dashboard, the dialog warns that you cannot reassign the role from OpenShift AI. To reassign this role, you must use the OpenShift web console or CLI.
- Click Unassign role to confirm.
Verification
- The role assignment no longer appears on the Permissions tab.
- The affected user or group can no longer perform the actions that the removed role permitted.
5.7. Custom workbench roles reference Copy linkLink copied to clipboard!
Custom workbench roles are Kubernetes Role or ClusterRole objects that define fine-grained permissions for workbench resources. A Role is scoped to a single project namespace, while a ClusterRole can be reused across multiple projects. This reference describes the label requirements, available resources, and verbs that you can use to build custom roles.
5.7.1. Label requirement Copy linkLink copied to clipboard!
For a custom role to display in the OpenShift AI dashboard, you must apply the following label to the Role or ClusterRole object:
metadata:
labels:
opendatahub.io/dashboard: 'true'
Roles with this label are displayed with an AI role label in the Role type column in the dashboard, distinguishing them from default OpenShift roles.
5.7.2. Workbench resources and verbs Copy linkLink copied to clipboard!
Each workbench in OpenShift AI is a Notebook custom resource in the kubeflow.org API group. The following table describes the Kubernetes resource and verbs that you can use in the rules section of your Role or ClusterRole definition to control workbench operations.
| API group | Resource | Available verbs |
|---|---|---|
|
|
|
|
5.7.3. Example role definitions Copy linkLink copied to clipboard!
The following examples show common custom role configurations for workbenches.
Workbench reader
Allows a user to view workbench configurations and status without making changes.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: workbench-reader
labels:
opendatahub.io/dashboard: 'true'
rules:
- apiGroups:
- kubeflow.org
resources:
- notebooks
verbs:
- get
- list
- watch
Workbench operator
Allows a user to start and stop existing workbenches without creating or deleting them.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: workbench-operator
labels:
opendatahub.io/dashboard: 'true'
rules:
- apiGroups:
- kubeflow.org
resources:
- notebooks
verbs:
- get
- list
- watch
- patch
Workbench editor
Allows a user to create and modify workbenches without deleting them.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: workbench-editor
labels:
opendatahub.io/dashboard: 'true'
rules:
- apiGroups:
- kubeflow.org
resources:
- notebooks
verbs:
- create
- get
- list
- watch
- update
- patch
The example roles above do not include the delete verb. To grant delete permissions for workbenches, add delete to the verbs list in your custom role’s rules.
5.7.4. Default project roles Copy linkLink copied to clipboard!
The following default roles remain available in the OpenShift AI dashboard alongside custom roles:
| Role | Permissions |
|---|---|
| Admin | Can edit project details and manage access to the project. |
| Contributor | Can view and edit project components, such as workbenches, connections, and storage. |
Custom roles supplement these default roles. When a user has both a default role and one or more custom roles, the effective permissions are the union of all assigned roles.