Skip to content

Commit 4189030

Browse files
d-bytebaseclaude
andauthored
docs: reorganize users and groups documentation (#822)
- Move Users and Groups content from data-model.mdx to user-groups.mdx - Rename user-groups.mdx title from "User Groups" to "Users and Groups" - Add Service Account section explaining their purpose - Consolidate and simplify constraints about service accounts in groups - Convert constraints to Note component for better visibility - Rename Role section to IAM and link both Users/Groups and Roles/Permissions - Reorder navigation to show Users and Groups before Roles and Permissions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent 85811d9 commit 4189030

File tree

19 files changed

+169
-124
lines changed

19 files changed

+169
-124
lines changed

mintlify/administration/custom-approval.mdx

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,70 @@ feature_name: CUSTOM_APPROVAL
99

1010
<iframe width="675" height="380" src="https://www.youtube.com/embed/K_RWlqdplZQ" title="YouTube video player" className="w-full" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowFullScreen"></iframe>
1111

12-
<Tip>
12+
## Overview
1313

14-
- Custom Approval is mostly used by [UI workflow](/change-database/change-workflow/#ui-workflow). If you use [GitOps workflow](/change-database/change-workflow/#gitops-workflow), we recommend you to configure approval in the PR/MR process.
15-
- By default, you **can not** self-approve your own created issue even if you are a qualified approver. You
16-
can [toggle](/change-database/issue/#self-approval) this behavior under project settings.
14+
Custom Approval allows you to create multi-stage approval workflows based on change risk levels. Each database change can require approvals from specific roles before proceeding to rollout.
1715

16+
<Tip>
17+
**Best Practices:**
18+
- Custom Approval works best with [UI workflow](/change-database/change-workflow/#ui-workflow). For [GitOps workflow](/change-database/change-workflow/#gitops-workflow), configure approvals in your PR/MR process instead.
19+
- By default, users cannot self-approve their own issues. You can [change this setting](/change-database/issue/#self-approval) in project settings if needed.
1820
</Tip>
1921

20-
In **Settings > Custom Approval**, you can choose which approval flow to use for a [risk level](/administration/risk-center) and define approval flows.
22+
## How It Works
23+
24+
### Approval Flow Structure
25+
26+
An approval flow consists of one or more **approval nodes** arranged in sequence:
27+
- Each node specifies a role (e.g., `Project Owner`, `DBA`, or custom role)
28+
- Any member with that role can approve the node
29+
- All nodes must be approved before the issue proceeds to rollout
2130

22-
An approval flow can contain one or multiple approval nodes. Each approval node specifies a role. Any member
23-
of the role can approve that node. An issue will enter the rollout stage once all nodes have been approved.
24-
Note, depending on how the [rollout policy](/administration/environment-policy/rollout-policy/) is configured,
25-
it may still require another step to deploy the change manually.
31+
<Note>
32+
After approval, the actual deployment may still require manual action depending on your [rollout policy](/administration/environment-policy/rollout-policy/) configuration.
33+
</Note>
2634

2735
![Approval Flow](/content/docs/administration/custom-approval/edit-approval-flow.webp)
2836

29-
To create or update approval flows, click the **Approval Flows** tab.
37+
## Setting Up Custom Approval
38+
39+
### Step 1: Create Approval Flows
40+
41+
1. Navigate to **Settings > Custom Approval**
42+
2. Click the **Approval Flows** tab
43+
3. Create or edit an approval flow
44+
4. Add approval nodes with required roles
45+
46+
### Step 2: Assign Flows to Risk Levels
47+
48+
1. Click the **Rules** tab
49+
2. Select an approval flow for each [risk level](/administration/risk-center)
50+
3. Choose "Skip manual approval" if no approval is needed for a specific risk level
51+
52+
## Working with Custom Roles
53+
54+
When built-in roles don't match your approval requirements, you can create [custom roles](/administration/roles) with specific permissions.
55+
56+
**Example use cases:**
57+
- Create a `Tester` role for QA approval
58+
- Define a `Compliance Officer` role for regulatory review
59+
- Set up a `Release Manager` role for deployment coordination
60+
61+
### Adding Custom Roles to Approval Flows
62+
63+
1. First, [create the custom role](/administration/roles#creating-custom-roles)
64+
2. Navigate to **CI/CD > Custom Approval**
65+
3. Select the **Approval Flows** tab
66+
4. Edit your approval flow and add the custom role as an approval node
3067

31-
## Rules
68+
![add-to-custom-approval-flow](/content/docs/administration/custom-approval/add-to-custom-approval-flow.webp)
3269

33-
To choose the approval flow for a risk level, click the **Rules** tab.
34-
Choose the preset "Skip manual approval" approval flow for a risk if you don't want an approval flow at all.
70+
## Approval Process
3571

36-
## Custom roles
72+
When an issue matches a configured risk level:
3773

38-
Sometimes, the predefined project roles might not fit your needs. e.g. You require tester to approve.
39-
In that case, you can use [custom roles](/administration/custom-roles).
74+
1. The issue enters the approval stage
75+
2. Designated approvers receive notifications
76+
3. Each approval node must be approved in sequence
77+
4. After all approvals, the issue proceeds based on rollout policy
78+
5. Changes are deployed automatically or manually as configured

mintlify/administration/custom-roles.mdx

Lines changed: 0 additions & 40 deletions
This file was deleted.

mintlify/concepts/roles-and-permissions.mdx renamed to mintlify/administration/roles.mdx

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,92 @@
11
---
22
title: Roles and Permissions
3+
feature_name: CUSTOM_ROLES
34
---
45

56
<Card title="Tutorial: How to Manage Roles" icon="graduation-cap" href="/tutorials/how-to-manage-roles" horizontal />
67

78
## Overview
89

9-
Bytebase employs RBAC (Role-Based-Access-Control). Permissions are assigned to roles and roles are
10-
granted to the users and groups.
10+
Bytebase uses RBAC (Role-Based Access Control) to manage permissions. A **role** is a collection of permissions that can be granted to users and user groups.
1111

12-
**Workspace Roles**
12+
### Permission Scope
1313

14-
Built-in roles: `Workspace Admin`, `Workspace DBA`, `Workspace Member`.
14+
Permissions in Bytebase apply to two levels of resources:
1515

16-
The workspace role maps to the roles at the organization level. Every Bytebase user has `Workspace Member` role.
17-
Users can also be granted `Workspace Admin`, `Workspace DBA`. These 2 roles should be granted judiciously though.
16+
- **Workspace-level resources**: Settings, instances, environments, and overall workspace management
17+
- **Project-level resources**: Project settings, databases, issues, and project-specific operations
1818

19-
**Project Roles**
19+
### Role Types
2020

21-
- Built-in roles: `Project Owner`, `Project Developer`, `Project Releaser`, `SQL Editor User` (previously called `Project Querier`), `Project Exporter`, `Project Viewer`.
22-
- [Custom roles](/administration/custom-roles/).
21+
Bytebase provides two types of roles:
2322

24-
In addition to the inherent `Workspace Member` role, most users will be granted project roles. These roles
25-
allow users to perform specific database operations.
23+
#### Built-in Roles
2624

27-
<Tip>
25+
**Workspace roles:**
26+
- `Workspace Admin` - Full administrative control
27+
- `Workspace DBA` - Database administration across all projects
28+
- `Workspace Member` - Basic access (automatically assigned to all users)
29+
30+
**Project roles:**
31+
- `Project Owner` - Full control over project resources
32+
- `Project Developer` - Create and manage database changes
33+
- `Project Releaser` - Approve and release changes
34+
- `SQL Editor User` - Query databases (formerly `Project Querier`)
35+
- `Project Exporter` - Export data
36+
- `Project Viewer` - Read-only access
37+
38+
#### Custom Roles
39+
40+
Organizations can create custom roles with specific permission sets tailored to their needs. Custom roles are defined at the workspace level and can be granted at both workspace and project levels.
2841

29-
To grant users a project role for all the projects, grant that project role at the workspace level.
42+
### Granting Roles
3043

44+
Roles are granted through IAM policies at two levels:
45+
46+
1. **Workspace IAM Policy** (Workspace > Members page)
47+
- Grant roles that apply across all projects
48+
- Manage workspace-level permissions
49+
50+
2. **Project IAM Policy** (Project > Members page)
51+
- Grant roles for specific project resources
52+
- Inherits roles granted at the workspace level
53+
54+
<Tip>
55+
**Inheritance:** Project IAM policies automatically inherit roles granted at the workspace level. For example, if a user is granted `Project Developer` at the workspace level, they have that role in all projects.
3156
</Tip>
3257

3358
![org-role-mapping](/content/docs/rbac/org-role-mapping.webp)
3459

35-
Above diagram describes the mapping between an engineering org and the corresponding roles in the Bytebase workspace. Note, a particular user can be assigned multiple roles as well:
60+
## Creating Custom Roles
61+
62+
1. Navigate to **IAM & Admin > Custom Roles**
63+
2. Click **Add role**
64+
3. Configure permissions for your new role
65+
66+
![add-custom-role](/content/docs/administration/roles/add-custom-role.webp)
67+
68+
Use **Import from role** to start with an existing role's permissions and modify them as needed.
69+
70+
<Tip>
71+
**Example:** To create a role that can approve and comment on issues but not execute them, create a `Project Approver` role by importing from `Project Releaser` and removing execution permissions.
72+
</Tip>
73+
74+
## Granting Roles in IAM Policy
75+
76+
Roles (both built-in and custom) can be assigned to users and groups through the Members page at either workspace or project level:
3677

37-
- A user can only be assigned multiple workspace roles.
38-
- In a particular project, a user can be assigned multiple project roles. A user can also be assigned different project roles in the different projects.
78+
1. Navigate to **Members** page (either in Workspace or specific Project)
79+
2. Click **Grant Access** to add users or groups
80+
3. Select the appropriate roles to grant
81+
4. Confirm to apply the IAM policy changes
3982

40-
Real-world scenarios:
83+
When roles are granted at the workspace level, they automatically apply to all projects. Project-level grants only affect the specific project.
4184

42-
- Organizations may not establish a dedicated DBA or platform engineering group. In such case, usaually the application engineering group head and the tech leads will wear those hats. Say a user named Alice can be a `Workspace DBA` and a `Project Owner` for Project Apollo at the same time.
85+
![grant-project-member](/content/docs/administration/roles/grant-project-member.webp)
4386

44-
- An application developer could be involved in multiple projects. In such case, that engineer would also be assigned project roles in different projects respectively. Say a user named Bob can be a `Workspace Member`, a `Project Owner` for Project Apollo and a `Project Developer` for Project Mars at the same time.
87+
## Appendix
4588

46-
## Workspace roles
89+
### Workspace Role Permissions
4790

4891
By default, the first registered user is granted the `Admin` role, all following registered users are granted `Member` role. `Admin` can update any user's role later.
4992

@@ -84,10 +127,9 @@ By default, the first registered user is granted the `Admin` role, all following
84127
| Manage IM integration | | | ✔️ |
85128
| Change logo | | | ✔️ |
86129

87-
## Project roles
130+
### Project Role Permissions
88131

89-
Any user can create project. By default, the project creator is granted the `Project Owner` role.
90-
`Workspace DBA` and `Workspace Admin` assume the `Project Owner` role for all projects.
132+
Any user can create project. By default, the project creator is granted the `Project Owner` role. `Workspace DBA` and `Workspace Admin` assume the `Project Owner` role for all projects.
91133

92134
| Project Permission | SQL Editor User | Project Exporter | Project Developer | Project Owner | Workspace DBA | Workspace Admin |
93135
| ---------------------------- | --------------- | ---------------- | ----------------- | ------------- | ------------- | --------------- |
@@ -96,7 +138,7 @@ Any user can create project. By default, the project creator is granted the `Pro
96138
| Archive project | | | | ✔️ | ✔️ | ✔️ |
97139
| Configure UI/GitOps workflow | | | | ✔️ | ✔️ | ✔️ |
98140

99-
## Database permissions
141+
### Database Permissions
100142

101143
Bytebase does not define database specific roles. Whether a user can perform certain action to the database is based on the user's Workspace role and the role of the project owning the database.
102144

@@ -107,15 +149,15 @@ Bytebase does not define database specific roles. Whether a user can perform cer
107149
| Edit database label | | | | ✔️ | ✔️ | ✔️ |
108150
| Transfer database | | | | ✔️ | ✔️ | ✔️ |
109151

110-
## Sheet permissions
152+
### Sheet Permissions
111153

112154
User can save sheets from [SQL Editor](/sql-editor/overview). A sheet always belongs to a project. Sheet has three visibility levels:
113155

114156
- Private
115157
- Project
116158
- Public
117159

118-
### Private Sheet
160+
#### Private Sheet
119161

120162
| Permission | Creator | SQL Editor User | Project Exporter | Project Developer | Project Owner | Workspace DBA | Workspace Admin |
121163
| ---------- | ------- | --------------- | ---------------- | ----------------- | ------------- | ------------- | --------------- |
@@ -124,7 +166,7 @@ User can save sheets from [SQL Editor](/sql-editor/overview). A sheet always bel
124166
| Write | ✔️ | | | | | | |
125167
| Delete | ✔️ | | | | | | |
126168

127-
### Project Sheet
169+
#### Project Sheet
128170

129171
| Permission | Creator | SQL Editor User | Project Exporter | Project Developer | Project Owner | Workspace DBA | Workspace Admin |
130172
| ---------- | ------- | --------------- | ---------------- | ----------------- | ------------- | ------------- | --------------- |
@@ -133,7 +175,7 @@ User can save sheets from [SQL Editor](/sql-editor/overview). A sheet always bel
133175
| Write | ✔️ | | | | ✔️ | ✔️ | ✔️ |
134176
| Delete | ✔️ | | | | ✔️ | ✔️ | ✔️ |
135177

136-
### Public Sheet
178+
#### Public Sheet
137179

138180
| Permission | Creator | SQL Editor User | Project Exporter | Project Developer | Project Owner | Others |
139181
| ---------- | ------- | --------------- | ---------------- | ----------------- | ------------- | ------ |
@@ -142,7 +184,7 @@ User can save sheets from [SQL Editor](/sql-editor/overview). A sheet always bel
142184
| Write | ✔️ | | | | ✔️ | |
143185
| Delete | ✔️ | | | | ✔️ | |
144186

145-
## Issue permissions
187+
### Issue Permissions
146188

147189
| Issue Permission | Assignee | Creator | SQL Editor User | Project Exporter | Project Developer | Project Owner | Workspace DBA | Workspace Admin |
148190
| ------------------------- | -------- | ------- | --------------- | ---------------- | ----------------- | ------------- | ------------- | --------------- |
@@ -153,4 +195,4 @@ User can save sheets from [SQL Editor](/sql-editor/overview). A sheet always bel
153195
| Subscribe/Unsubscribe | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
154196
| Add comment | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
155197

156-
\* `Project Owner` can change issue status when the current active [Environment Rollout Policy](/administration/environment-policy/rollout-policy) is set to **Require manual rolling out**.
198+
\* `Project Owner` can change issue status when the current active [Environment Rollout Policy](/administration/environment-policy/rollout-policy) is set to **Require manual rolling out**.

mintlify/administration/user-groups.mdx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
---
2-
title: User Groups
2+
title: Users and Groups
33
feature_name: USER_GROUPS
44
---
55

6-
`User Group` or simply `Group` contains a set of users. `Group` simplifies access management as you can grant
7-
roles to a `Group` instead of granting to the individual users one by one.
6+
## User
87

9-
## Constraints
8+
A `User` represents anyone who can access and perform operations in Bytebase. Users include both human team members and service accounts.
109

11-
- Bytebase does not support nested group. A group can only contain users, it can't contain another group.
12-
- You can only add normal user account to the group and can not add service account. Service account within a group is an [anti-pattern](https://cloud.google.com/iam/docs/best-practices-service-accounts#groups).
10+
## Service Account
11+
12+
Service accounts are special users designed for automated processes and applications.
13+
14+
## User Group
15+
16+
A `User Group` organizes multiple users together for easier permission management. Workspace admins create groups and add users, then assign these groups to roles within projects.
17+
18+
<Note>
19+
- Bytebase does not support nested groups. A group can only contain users, it can't contain another group.
20+
- Service accounts cannot be part of user groups. Since service accounts are for automated processes with specific access needs, including them in groups could grant unintended permissions. This is considered an [anti-pattern](https://cloud.google.com/iam/docs/best-practices-service-accounts#groups).
21+
</Note>
1322

1423
## Add group
1524

@@ -48,9 +57,3 @@ Now you can see the `Contractor Group` under **View by members** page as well as
4857
![project-members-or-roles](/content/docs/administration/user-groups/project-members-or-roles.webp)
4958

5059
All members within this group now share permission to the project.
51-
52-
## Service account
53-
54-
You can only add normal user account to the group and can not add service account.
55-
56-
Service accounts are designed for application use, with each application typically having unique access needs. Since applications rarely perform identical functions, their required resource access tends to differ, making shared or identical permissions uncommon.

mintlify/changelog/bytebase-1-17-0.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import InstallUpgrade from '/snippets/install/install-upgrade.mdx';
1010
## 🚀 New Features
1111

1212
- Sync schema to [multiple target databases](/change-database/synchronize-schema).
13-
- [Configure](/administration/custom-roles) custom roles for projects.
13+
- [Configure](/administration/roles) custom roles for projects.
1414
- Support OceanBase & Redshift.
1515
- New language option: Spanish 🇪🇸.
1616

mintlify/changelog/bytebase-2-11-0.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import InstallUpgrade from '/snippets/install/install-upgrade.mdx';
1010
## 🚀 New Features
1111

1212
- Support setting parameters for MySQL online schema change.
13-
- Add **database viewer** role to **Project**. (Check [Roles and Permissions](/concepts/roles-and-permissions/))
13+
- Add **database viewer** role to **Project**. (Check [Roles and Permissions](/administration/roles))
1414
- Support OceanBase in Oracle Mode.
1515

1616
## 🎄 Enhancements

0 commit comments

Comments
 (0)