Skip to content

Commit e6a46f2

Browse files
committed
chore: create db/table/udf/stage add Access control requirements
1 parent bf85feb commit e6a46f2

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

docs/en/guides/56-security/access-control/01-privileges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Databend offers a range of privileges that allow you to exercise fine-grained co
109109
| ALL | All | Grants all the privileges for the specified object type. |
110110
| ALTER | Global, Database, Table, View | Alters a database, table, user or UDF. |
111111
| CREATE | Global, Table | Creates a table or UDF. |
112-
| CREATE DATABASE | Global | Creates a database, table or UDF. |
112+
| CREATE DATABASE | Global | Creates a database or UDF. |
113113
| CREATE WAREHOUSE | Global | Creates a warehouse. |
114114
| DELETE | Table | Deletes or truncates rows in a table. |
115115
| DROP | Global, Database, Table, View | Drops a database, table, view or UDF. Undrops a table. |

docs/en/sql-reference/10-sql-commands/00-ddl/00-database/ddl-create-database.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Create a database.
1515
CREATE [ OR REPLACE ] DATABASE [ IF NOT EXISTS ] <database_name>
1616
```
1717

18+
## Access control requirements
19+
20+
| Privilege | Object Type | Description |
21+
|:----------------|:------------|:--------------------|
22+
| CREATE DATABASE | Global | Creates a database. |
23+
24+
25+
To create a database, the user performing the operation or the [current_role](/guides/security/access-control/roles) must have the CREATE DATABASE [privilege](/guides/security/access-control/privileges).
26+
1827
## Examples
1928

2029
The following example creates a database named `test`:

docs/en/sql-reference/10-sql-commands/00-ddl/01-table/10-ddl-create-table.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ When choosing between stored computed columns and virtual computed columns, cons
192192

193193
Databend's syntax is difference from MySQL mainly in the data type and some specific index hints.
194194

195+
## Access control requirements
196+
197+
| Privilege | Object Type | Description |
198+
|:----------|:--------------|:-----------------------|
199+
| CREATE | Global, Table | Creates a table. |
200+
201+
202+
To create a table, the user performing the operation or the [current_role](/guides/security/access-control/roles) must have the CREATE [privilege](/guides/security/access-control/privileges#table-privileges).
203+
204+
195205
## Examples
196206

197207
### Create Table

docs/en/sql-reference/10-sql-commands/00-ddl/03-stage/01-ddl-create-stage.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ copyOptions ::=
125125
| `SIZE_LIMIT = <num>` | Number (> 0) that specifies the maximum rows of data to be loaded for a given COPY statement. Default `0` | Optional |
126126
| `PURGE = <bool>` | True specifies that the command will purge the files in the stage if they are loaded successfully into table. Default `false` | Optional |
127127

128+
129+
## Access control requirements
130+
131+
| Privilege | Object Type | Description |
132+
|:----------|:--------------|:--------------------------------------------------------------------------|
133+
| SUPER | Global, Table | Operates a stage(Lists stages. Creates, Drops a stage), catalog or share. |
134+
135+
To create a stage, the user performing the operation or the [current_role](/guides/security/access-control/roles) must have the SUPER [privilege](/guides/security/access-control/privileges).
136+
128137
## Examples
129138

130139
### Example 1: Create Internal Stage

docs/en/sql-reference/10-sql-commands/00-ddl/10-udf/ddl-create-function.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ CREATE [ OR REPLACE ] FUNCTION [ IF NOT EXISTS ] <function_name>
1616
[ DESC='<description>' ]
1717
```
1818

19+
## Access control requirements
20+
21+
| Privilege | Object Type | Description |
22+
|:----------|:--------------|:---------------|
23+
| SUPER | Global, Table | Operates a UDF |
24+
25+
To create a user-defined function, the user performing the operation or the [current_role](/guides/security/access-control/roles) must have the SUPER [privilege](/guides/security/access-control/privileges).
26+
1927
## Examples
2028

2129
See [Usage Examples](/guides/query/udf#usage-examples).

0 commit comments

Comments
 (0)