docs/en/operations/settings/permissions-for-queries.md
Queries in ClickHouse can be divided into several types:
SELECT, SHOW, DESCRIBE, EXISTS.INSERT, OPTIMIZE.SET, USE.CREATE, ALTER, RENAME, ATTACH, DETACH, DROP TRUNCATE.KILL QUERY.The following settings regulate user permissions by the type of query:
Restricts permissions for read data, write data, and change settings queries.
When set to 1, allows:
When set to 2, allows the above plus:
SET and CREATE TEMPORARY TABLE
:::tip Queries like EXISTS, DESCRIBE, EXPLAIN, SHOW PROCESSLIST, etc are equivalent to SELECT, because they just do select from system tables. :::
Possible values:
Default value: 0
:::note
After setting readonly = 1, the user can't change readonly and allow_ddl settings in the current session.
When using the GET method in the HTTP interface, readonly = 1 is set automatically. To modify data, use the POST method.
Setting readonly = 1 prohibits the user from changing settings. There is a way to prohibit the user from changing only specific settings. Also there is a way to allow changing only specific settings under readonly = 1 restrictions. For details see constraints on settings.
:::
Allows or denies DDL queries.
Possible values:
Default value: 1
:::note
You cannot run SET allow_ddl = 1 if allow_ddl = 0 for the current session.
:::
:::note KILL QUERY
KILL QUERY can be performed with any combination of readonly and allow_ddl settings.
:::