> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytebase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Manage Roles

> Assign a manager role who can only deploy issue but not query or change database.

A typical requirement is to create a `Manager` role in Bytebase who can only deploy issue but not query or change database. This tutorial will show you how to achieve this with two approaches:

* Using a system predefined role
* Creating a custom role

<img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/rbac-graph.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=9705f946f30b01a843bb0c1058263171" alt="rbac-graph" width="1955" height="970" data-path="content/docs/tutorials/how-to-manage-roles/rbac-graph.webp" />

## Approach 1: Using a System Predefined Role

1. Log in Bytebase, go to **IAM & Admin > Custom Roles**. You'll see that besides three **Workspace** level roles: **Admin/DBA/Member**; at **Project** level, Bytebase also predefined several system roles:

   * **Project Owner**: All permissions within the project
   * **Project Developer**: All viewer permissions, plus permissions for requesting database changes.
   * **SQL Editor User**: Permissions for querying database data.
   * **Project Releaser**: All viewer permissions, plus permission for reviewing database change requests for release purposes.
   * **Project Viewer**: Read-only permissions for viewing basic project information, accessing databases, and initiating privilege requests.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-system-roles.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=591cd1dc42cfea16f09872031efcbbca" alt="bb-system-roles" width="1317" height="683" data-path="content/docs/tutorials/how-to-manage-roles/bb-system-roles.webp" />

2. You may find the `Project Releaser` is the role our customer wants to create. So the easiest way is to use this role directly along with another step config: Go to **Environments**, select the environment and go to **Rollout Policy** section. Check **Manual rollout by dedicated roles** and `Project releaser`. For Manual rollout, you need to have **Pro or Enterprise Plan** licenses.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-rollout-policy.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=4f4479bae328dce387dc0d6e7aba57ba" alt="bb-rollout-policy" width="1544" height="828" data-path="content/docs/tutorials/how-to-manage-roles/bb-rollout-policy.webp" />

3. Now, the role is ready. There are two ways to assign this role to our manager.

   ### Assign role at the Workspace level

   You can assign the `Project Releaser` role to the manager at the **Workspace** level. Then the manager will
   obtain the `Project Releaser` role for all projects.

   #### Create user

   Create the user if not added yet. Go to **IAM & Admin > Users & Groups**, click **Add User**.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-workspace-user-role.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=cbda20387d75304efbca7c47898133a1" alt="bb-workspace-user-role" width="2422" height="1142" data-path="content/docs/tutorials/how-to-manage-roles/bb-workspace-user-role.webp" />

   #### Grant role

   Go to **IAM & Admin > Members** click **Grant Access**.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-workspace-grant-access.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=ca4ee6da296eab21dff27c97ac774aac" alt="bb-workspace-grant-access" width="2440" height="1148" data-path="content/docs/tutorials/how-to-manage-roles/bb-workspace-grant-access.webp" />

   ### Assign role at the Project level

   If you want to assign the role to the manager user for a single project, go to the project > **Manage** > **Members**, click **Grant Access**.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-project-grant-access.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=152cadeac429582a2cc75e281d25d75c" alt="bb-project-grant-access" width="2636" height="1190" data-path="content/docs/tutorials/how-to-manage-roles/bb-project-grant-access.webp" />

## Approach 2: Creating a Custom Role

What if you want to create a custom role with slightly differet permissions or you just want to rename it as a manager role?

1. Go to **IAM & Admin > Custom Roles**, and click **Add Role** button on the top right.

2. Click **Import from role**, here you choose `Project releaser` and click **Confirm**. The related permissions will be imported.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-add-role-releaser-import.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=b2398b972f03333f2589fef94bdf65f8" alt="bb-add-role-releaser-import" width="2564" height="1174" data-path="content/docs/tutorials/how-to-manage-roles/bb-add-role-releaser-import.webp" />

3. As a manager, you can add two more permissions: `auditLogs.search` and `auditLogs.export`. Click **Add**.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-role-audit.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=12f6069d11184b7591a94a9c31a46c42" alt="bb-role-audit" width="2630" height="1186" data-path="content/docs/tutorials/how-to-manage-roles/bb-role-audit.webp" />

4. Go back to **Environments**, select the environment and go to **Rollout Policy** section. Check **Manual rollout by dedicated roles** and **Custom project roles > Project Manager**.

   <img src="https://mintcdn.com/dbx/QHI-wM3-9mvQwL51/content/docs/tutorials/how-to-manage-roles/bb-env-rollout-policy-manager.webp?fit=max&auto=format&n=QHI-wM3-9mvQwL51&q=85&s=c95a771581bbe2d775c0a7768bf56ee1" alt="bb-env-rollout-policy-manager" width="1528" height="862" data-path="content/docs/tutorials/how-to-manage-roles/bb-env-rollout-policy-manager.webp" />

5. The same as for `Project Releaser`, you can assign the role to our manager user at **Workspace** or **Project** level.

## Summary

By utilizing either a system predefined role or creating a custom role, you can grant permissions for database rollout while restricting query and modification access.
