Skip to content

Commit 8c650ba

Browse files
docs: switch role in worksheet (#1030)
* updated * Update 02-user-show-users.md * Update 01-members.md --------- Co-authored-by: Quan <[email protected]>
1 parent c0d97fb commit 8c650ba

File tree

7 files changed

+35
-38
lines changed

7 files changed

+35
-38
lines changed

docs/en/guides/20-cloud/10-using-databend-cloud/01-worksheet.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
---
22
title: Work with Worksheets
33
---
4+
import DbSVG from '@site/static/img/icon/database.svg'
5+
import RoleSVG from '@site/static/img/icon/role.svg'
6+
import WarehouseSVG from '@site/static/img/icon/warehouse.svg'
47

58
The worksheet is an important tool in Databend Cloud used for organizing and managing SQL statements. You can edit and run SQL statements in a worksheet, as well as save them in the worksheet for future reference and use. This can greatly improve work efficiency and avoid repetitive coding.
69

7-
To open a new worksheet, click on **Worksheets** in the sidebar and select **New Worksheet**.
8-
9-
![Alt text](@site/static/img/documents/worksheet/worksheet.png)
10-
11-
The worksheet interface is divided into the following parts:
12-
13-
- Sidebar (left side): Shows existing databases and tables, making it easy to copy table and column names to the editor. It also allows data preview and facilitates pipeline creation.
14-
- Editor (upper right): The area where you edit SQL statements.
15-
- Output area (lower right): Displays query results.
10+
To create a new worksheet, click on **Worksheets** in the sidebar and select **New Worksheet**.
1611

1712
## Editing and Running SQL Statements
1813

1914
To edit and run an SQL statement:
2015

21-
1. Click on the database button above the SQL input area and select the database you want to query.
22-
2. Edit the SQL statement in the editor.
23-
3. Choose a warehouse: click the button to the right of **Run Script** and select a warehouse from the list.
16+
1. Click on the database icon <DbSVG/> above the SQL editor and select the database you want to query.
17+
2. Click on the user icon <RoleSVG/> above the SQL editor and choose a role to use. The dropdown list will display all the roles you have been granted, along with any child roles under your roles in the hierarchy. For more information about the role hierarchy, see [Inheriting Roles & Establishing Hierarchy](/guides/security/access-control/roles#inheriting-roles--establishing-hierarchy).
18+
19+
3. Edit the SQL statement in the SQL editor.
20+
4. Click on the warehouse icon <WarehouseSVG/> under the SQL editor and select a warehouse from the list.
2421
4. Click **Run Script**.
2522

2623
The query result shows in the output area. You can click **Export** to save the whole result to a CSV file, or select one or multiple cells in the output area and press Command + C (on Mac) or Ctrl + C (on Windows) to copy them to your clipboard.

docs/en/guides/20-cloud/20-manage/01-members.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,20 @@
22
title: Members
33
---
44

5-
## User Roles
5+
To view all the members in your organization, go to **Manage** > **Members**. This page provides a list of all members, including their email addresses, roles, join times, and last active times. If you're an `account_admin`, you can also change a member's role or remove a member from your organization.
66

7-
In Databend Cloud, user management is facilitated through roles. An organization within Databend Cloud is equipped with default roles, each serving distinct purposes:
7+
- The roles listed show the roles assigned to users when they were invited. While these roles can be changed on the page, they cannot be revoked using SQL. However, you can grant additional roles or privileges to users based on their email addresses. These user accounts, identified by their email addresses, can also function as SQL users in Databend Cloud. Example:
88

9-
- account_admin: Positioned at the apex of the role hierarchy, this role embodies the highest level of authority within an organization. It is intended for users who undertake the responsibilities of database administrators.
9+
```sql
10+
GRANT ROLE writer to '[email protected]';
11+
GRANT SELECT ON *.* TO '[email protected]';
12+
```
1013

11-
- public: This role encompasses all users within the organization, providing a baseline level of access and permissions.
12-
13-
Furthermore, Databend Cloud offers the capability to craft custom roles using SQL commands for a more nuanced and tailored user management approach. This empowers you with the flexibility to establish roles that align with specific requirements. For instance, roles can be devised to correspond to users' positions, thus establishing a hierarchical role structure for your organization:
14-
15-
![Alt text](@site/static/img/documents/org-and-users/role.png)
16-
17-
When inviting a new user, it's necessary to assign a role to them. You can also manage roles for all users in your organization through the **Manage** > **Members** page or by using SQL commands.
18-
19-
:::note
20-
- The default roles within an organization are not editable or removable.
21-
22-
- Only users assigned to the *account_admin* role can create roles and manage user roles for their organization.
23-
:::
14+
- The page does not display users created using SQL. To view the SQL users that have been created, use the [SHOW USERS](/sql/sql-commands/ddl/user/user-show-users) command.
2415

2516
## Inviting New Members
2617

27-
In Databend Cloud, you can invite new members using their email addresses to join your organization. To do this, navigate to the **Manage** > **Members** page and click on **Invite New Member**. In the dialog box that appears, enter the user's email address and select a role from the list. This list includes both default roles and any custom roles created for your organization.
18+
To invite a new member to your organization, navigate to the **Manage** > **Members** page and click on **Invite New Member**. In the dialog box that appears, enter the user's email address and select a role from the list. This list includes built-in roles and any created roles created for your organization. For more information about the roles, see [Roles](/guides/security/access-control/roles).
2819
2920
An invitation email will be sent to the invited user. Inside the email, there will be a link that the user can click on to initiate the signup process.
3021

docs/en/guides/56-security/access-control/02-roles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If `enable_experimental_rbac_check` is not manually set to `1`, UDFs and stages
1414

1515
## Inheriting Roles & Establishing Hierarchy
1616

17-
Databend roles introduce a potent mechanism through role granting, enabling one role to inherit permissions and responsibilities from another. This contributes to the creation of a flexible hierarchy, similar to the organizational structure, where two [Built-in Roles](#built-in-roles) exist: the highest being `account-admin` and the lowest being `public`.
17+
Role granting enables one role to inherit permissions and responsibilities from another. This contributes to the creation of a flexible hierarchy, similar to the organizational structure, where two [Built-in Roles](#built-in-roles) exist: the highest being `account-admin` and the lowest being `public`.
1818

1919
Consider the scenario where three roles are created: *manager*, *engineer*, and *intern*. In this example, the role of *intern* is granted to the engineer *role*. Consequently, the *engineer* not only possesses their own set of privileges but also inherits those associated with the *intern* role. Extending this hierarchy further, if the *engineer* role is granted to the *manager*, the *manager* now acquires both the inherent privileges of the *engineer* and the *intern* roles.
2020

docs/en/sql-reference/10-sql-commands/00-ddl/02-user/02-user-show-users.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: SHOW USERS
33
sidebar_position: 3
44
---
55

6-
Lists all the users in the system.
6+
Lists all SQL users in the system. If you're using Databend Cloud, this command also shows the user accounts (email addresses) within your organization that are used to log in to Databend Cloud.
77

88
## Syntax
99

@@ -14,13 +14,14 @@ SHOW USERS
1414
## Examples
1515

1616
```sql
17+
CREATE USER eric IDENTIFIED BY 'abc123';
18+
1719
SHOW USERS;
1820

19-
┌─────────────────────────────────────────────────────────────────────────────────────┐
20-
│ name │ hostname │ auth_type │ is_configured │ default_role │ disabled │
21-
├────────┼──────────┼──────────────────────┼───────────────┼───────────────┼──────────┤
22-
│ root │ % │ no_password │ YES │ account_admin │ false │
23-
│ u1 │ % │ double_sha1_password │ NO │ │ true │
24-
│ u2 │ % │ double_sha1_password │ NO │ │ false │
25-
└─────────────────────────────────────────────────────────────────────────────────────┘
21+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐
22+
│ name │ hostname │ auth_type │ is_configured │ default_role │ roles │ disabled │
23+
├────────┼──────────┼──────────────────────┼───────────────┼───────────────┼───────────────┼──────────┤
24+
│ eric │ % │ double_sha1_password │ NO │ │ │ false │
25+
│ root │ % │ no_password │ YES │ account_admin │ account_admin │ false │
26+
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
2627
```

static/img/icon/database.svg

Lines changed: 1 addition & 0 deletions
Loading

static/img/icon/role.svg

Lines changed: 1 addition & 0 deletions
Loading

static/img/icon/warehouse.svg

Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)