Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: add sqlEditorReadUser role and fix IAM binding environment migration (#19365)

Danny Xu51f84707e788
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index 49fbe75c2c..4e172d25c7 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -8229,9 +8229,9 @@ components:
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
- resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ resource.schema_name: the schema name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ resource.table_name: the table name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
diff --git a/backend/generated-go/v1/iam_policy.pb.go b/backend/generated-go/v1/iam_policy.pb.go
index 95d796b912..408b4f28b4 100644
--- a/backend/generated-go/v1/iam_policy.pb.go
+++ b/backend/generated-go/v1/iam_policy.pb.go
@@ -266,9 +266,9 @@ type Binding struct {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- // resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- // resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ // resource.schema_name: the schema name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ // resource.table_name: the table name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
// resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
// request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
//
diff --git a/backend/migrator/migration/3.15/0009##migrate_iam_binding_environment_condition.sql b/backend/migrator/migration/3.15/0009##migrate_iam_binding_environment_condition.sql
index 075d0545bf..17bb25b2de 100644
--- a/backend/migrator/migration/3.15/0009##migrate_iam_binding_environment_condition.sql
+++ b/backend/migrator/migration/3.15/0009##migrate_iam_binding_environment_condition.sql
@@ -1,8 +1,9 @@
--- For roles with bb.sql.ddl or bb.sql.dml permissions (excluding projectOwner),
--- add "resource.environment_id in [...]" to the binding condition expression
--- if it doesn't already have one.
--- The environment list is populated from existing QUERY_DATA policies:
--- environments where DDL or DML is not disallowed are included.
+-- Migrate IAM bindings based on environment DDL/DML policies.
+-- No-op if all environments allow both DDL and DML.
+-- Otherwise:
+-- 1. Replace sqlEditorUser with sqlEditorReadUser (keep existing conditions intact)
+-- 2. Add a new sqlEditorUser binding scoped to allowed environments
+-- 3. Scope custom roles with bb.sql.ddl/bb.sql.dml to allowed environments
WITH
-- Get all environment IDs from the setting table
@@ -36,18 +37,12 @@ env_list AS (
SELECT COALESCE(string_agg('"' || env_id || '"', ', '), '') AS env_ids
FROM allowed_envs
),
-roles_with_env_limitation AS (
- -- Predefined role with bb.sql.ddl/bb.sql.dml (excluding projectOwner)
- SELECT 'roles/sqlEditorUser' AS role_name
- UNION ALL
- -- Custom roles with bb.sql.ddl or bb.sql.dml
+-- Custom roles with bb.sql.ddl or bb.sql.dml
+custom_roles_with_env_limitation AS (
SELECT 'roles/' || resource_id AS role_name
FROM role
- WHERE resource_id != 'projectOwner'
- AND (
- permissions->'permissions' @> '["bb.sql.ddl"]'::jsonb
- OR permissions->'permissions' @> '["bb.sql.dml"]'::jsonb
- )
+ WHERE permissions->'permissions' @> '["bb.sql.ddl"]'::jsonb
+ OR permissions->'permissions' @> '["bb.sql.dml"]'::jsonb
)
UPDATE policy
SET payload = (
@@ -55,32 +50,67 @@ SET payload = (
payload,
'{bindings}',
(
- SELECT COALESCE(jsonb_agg(
- CASE
- WHEN binding->>'role' IN (SELECT role_name FROM roles_with_env_limitation)
- AND COALESCE(binding->'condition'->>'expression', '') NOT LIKE '%resource.environment_id%'
- THEN
- CASE
- -- condition key doesn't exist: create it with expression
- WHEN binding->'condition' IS NULL
- THEN binding || jsonb_build_object('condition', jsonb_build_object('expression', 'resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']'))
- -- condition exists but expression is empty or missing
- WHEN COALESCE(binding->'condition'->>'expression', '') = ''
- THEN jsonb_set(binding, '{condition,expression}', to_jsonb('resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']'))
- -- condition exists with non-empty expression: append
- ELSE jsonb_set(
- binding,
- '{condition,expression}',
- to_jsonb((binding->'condition'->>'expression') || ' && resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']')
- )
- END
- ELSE binding
- END
- ), '[]'::jsonb)
- FROM jsonb_array_elements(payload->'bindings') AS binding
+ SELECT COALESCE(jsonb_agg(new_binding ORDER BY ord), '[]'::jsonb)
+ FROM (
+ -- Existing bindings: swap sqlEditorUser -> sqlEditorReadUser,
+ -- and add env condition to custom roles with DDL/DML
+ SELECT rn AS ord,
+ CASE
+ -- sqlEditorUser: replace with sqlEditorReadUser
+ WHEN binding->>'role' = 'roles/sqlEditorUser'
+ AND COALESCE(binding->'condition'->>'expression', '') NOT LIKE '%resource.environment_id%'
+ THEN jsonb_set(binding, '{role}', '"roles/sqlEditorReadUser"')
+
+ -- Custom roles: add env condition
+ WHEN binding->>'role' IN (SELECT role_name FROM custom_roles_with_env_limitation)
+ AND COALESCE(binding->'condition'->>'expression', '') NOT LIKE '%resource.environment_id%'
+ THEN
+ CASE
+ -- condition key doesn't exist: create it with expression
+ WHEN binding->'condition' IS NULL
+ THEN binding || jsonb_build_object('condition', jsonb_build_object('expression', 'resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']'))
+ -- condition exists but expression is empty or missing
+ WHEN COALESCE(binding->'condition'->>'expression', '') = ''
+ THEN jsonb_set(binding, '{condition,expression}', to_jsonb('resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']'))
+ -- condition exists with non-empty expression: append
+ ELSE jsonb_set(binding, '{condition,expression}', to_jsonb((binding->'condition'->>'expression') || ' && resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']'))
+ END
+
+ ELSE binding
+ END AS new_binding
+ FROM jsonb_array_elements(payload->'bindings') WITH ORDINALITY AS t(binding, rn)
+
+ UNION ALL
+
+ -- New sqlEditorUser bindings scoped to allowed environments
+ SELECT 1000000 + rn AS ord,
+ CASE
+ WHEN binding->'condition' IS NULL OR COALESCE(binding->'condition'->>'expression', '') = ''
+ THEN jsonb_build_object(
+ 'role', 'roles/sqlEditorUser',
+ 'members', binding->'members',
+ 'condition', jsonb_build_object('expression', 'resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']')
+ )
+ ELSE jsonb_build_object(
+ 'role', 'roles/sqlEditorUser',
+ 'members', binding->'members',
+ 'condition', jsonb_build_object('expression', (binding->'condition'->>'expression') || ' && resource.environment_id in [' || (SELECT env_ids FROM env_list) || ']')
+ )
+ END AS new_binding
+ FROM jsonb_array_elements(payload->'bindings') WITH ORDINALITY AS t(binding, rn)
+ WHERE binding->>'role' = 'roles/sqlEditorUser'
+ AND COALESCE(binding->'condition'->>'expression', '') NOT LIKE '%resource.environment_id%'
+ AND (SELECT env_ids FROM env_list) != ''
+ ) sub
)
)
)
WHERE type = 'IAM'
AND resource_type = 'PROJECT'
- AND payload->'bindings' IS NOT NULL;
+ AND payload->'bindings' IS NOT NULL
+ -- Skip if all environments allow both DDL and DML
+ AND EXISTS (
+ SELECT 1 FROM all_envs e
+ JOIN env_policy ep ON e.env_id = ep.env_id
+ WHERE ep.disallow_ddl OR ep.disallow_dml
+ );
diff --git a/backend/store/predefined_roles.go b/backend/store/predefined_roles.go
index df494ab9eb..93cb29cad3 100644
--- a/backend/store/predefined_roles.go
+++ b/backend/store/predefined_roles.go
@@ -10,6 +10,7 @@ const (
ProjectOwnerRole = "projectOwner"
ProjectDeveloperRole = "projectDeveloper"
SQLEditorUserRole = "sqlEditorUser"
+ SQLEditorReadUserRole = "sqlEditorReadUser"
ProjectReleaserRole = "projectReleaser"
GitOpsServiceAgentRole = "gitopsServiceAgent"
ProjectViewerRole = "projectViewer"
@@ -487,6 +488,27 @@ var PredefinedRoles = []*RoleMessage{
permission.WorksheetsGet,
),
},
+ {
+ ResourceID: SQLEditorReadUserRole,
+ Name: "SQL Editor Read User",
+ Predefined: true,
+ Permissions: permissionSet(
+ permission.DatabaseCatalogsGet,
+ permission.DatabaseGroupsGet,
+ permission.DatabaseGroupsList,
+ permission.DatabasesCheck,
+ permission.DatabasesGet,
+ permission.DatabasesGetSchema,
+ permission.DatabasesList,
+ permission.DatabasesSync,
+ permission.ProjectsGet,
+ permission.ProjectsGetIAMPolicy,
+ permission.SQLExplain,
+ permission.SQLInfo,
+ permission.SQLSelect,
+ permission.WorksheetsGet,
+ ),
+ },
{
ResourceID: ProjectReleaserRole,
Name: "Project releaser",
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 372167a278..80aae7b612 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2738,6 +2738,10 @@
"self": "SQL Editor User",
"description": "Permissions for querying database data."
},
+ "sql-editor-read-user": {
+ "self": "SQL Editor Read User",
+ "description": "Read-only permissions for querying database data, without DDL or DML access."
+ },
"gitops-service-agent": {
"self": "GitOps Service Agent",
"description": "Permissions for automated CI/CD workflows to create and execute database changes via GitOps."
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 7dfe26df4c..c27c000a07 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2738,6 +2738,10 @@
"self": "Usuario del editor SQL",
"description": "El consultor del proyecto tiene todos los permisos dentro del proyecto, excepto la gestión de miembros del proyecto."
},
+ "sql-editor-read-user": {
+ "self": "Usuario de solo lectura del editor SQL",
+ "description": "Permisos de solo lectura para consultar datos de la base de datos, sin acceso DDL o DML."
+ },
"gitops-service-agent": {
"self": "Agente de Servicio GitOps",
"description": "Permisos para flujos de trabajo automatizados de CI/CD para crear y ejecutar cambios de base de datos a través de GitOps."
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 5159da929c..809ab0c8b8 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -2738,6 +2738,10 @@
"self": "SQLエディタのユーザー",
"description": "指定した範囲内のデータをクエリできます。"
},
+ "sql-editor-read-user": {
+ "self": "SQLエディタ読み取り専用ユーザー",
+ "description": "DDLまたはDMLアクセスなしで、データベースデータのクエリのための読み取り専用権限。"
+ },
"gitops-service-agent": {
"self": "GitOps サービスエージェント",
"description": "GitOps を介して自動化された CI/CD ワークフローでデータベース変更を作成および実行するための権限。"
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 37a049639f..f741700d2c 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -2738,6 +2738,10 @@
"self": "Người dùng Trình soạn thảo SQL",
"description": "Quyền truy vấn dữ liệu cơ sở dữ liệu."
},
+ "sql-editor-read-user": {
+ "self": "Người dùng Trình soạn thảo SQL chỉ đọc",
+ "description": "Quyền chỉ đọc để truy vấn dữ liệu cơ sở dữ liệu, không có quyền DDL hoặc DML."
+ },
"gitops-service-agent": {
"self": "Tác nhân Dịch vụ GitOps",
"description": "Quyền cho quy trình CI/CD tự động để tạo và thực thi các thay đổi cơ sở dữ liệu qua GitOps."
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 4f20cba8bf..17a3ae5198 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2738,6 +2738,10 @@
"self": "SQL 编辑器用户",
"description": "可查询指定范围的数据。"
},
+ "sql-editor-read-user": {
+ "self": "SQL 编辑器只读用户",
+ "description": "只读权限,可查询数据库数据,不包含 DDL 或 DML 访问权限。"
+ },
"gitops-service-agent": {
"self": "GitOps 服务代理",
"description": "通过 GitOps 自动化 CI/CD 工作流创建和执行数据库变更的权限。"
diff --git a/frontend/src/types/iam/role.ts b/frontend/src/types/iam/role.ts
index 8b78a8187f..87dedeeed8 100644
--- a/frontend/src/types/iam/role.ts
+++ b/frontend/src/types/iam/role.ts
@@ -7,6 +7,7 @@ export enum PresetRoleType {
PROJECT_OWNER = `${roleNamePrefix}projectOwner`,
PROJECT_DEVELOPER = `${roleNamePrefix}projectDeveloper`,
SQL_EDITOR_USER = `${roleNamePrefix}sqlEditorUser`,
+ SQL_EDITOR_READ_USER = `${roleNamePrefix}sqlEditorReadUser`,
PROJECT_RELEASER = `${roleNamePrefix}projectReleaser`,
GITOPS_SERVICE_AGENT = `${roleNamePrefix}gitopsServiceAgent`,
PROJECT_VIEWER = `${roleNamePrefix}projectViewer`,
@@ -25,6 +26,7 @@ export const PRESET_PROJECT_ROLES: string[] = [
PresetRoleType.PROJECT_DEVELOPER,
PresetRoleType.PROJECT_RELEASER,
PresetRoleType.SQL_EDITOR_USER,
+ PresetRoleType.SQL_EDITOR_READ_USER,
PresetRoleType.PROJECT_VIEWER,
PresetRoleType.GITOPS_SERVICE_AGENT,
];
diff --git a/frontend/src/types/proto-es/v1/iam_policy_pb.d.ts b/frontend/src/types/proto-es/v1/iam_policy_pb.d.ts
index d8791da12e..79b4af0b1f 100644
--- a/frontend/src/types/proto-es/v1/iam_policy_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/iam_policy_pb.d.ts
@@ -130,9 +130,9 @@ export declare type Binding = Message<"bytebase.v1.Binding"> & {
* The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
*
* Support variables:
- * resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- * resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- * resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ * resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ * resource.schema_name: the schema name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ * resource.table_name: the table name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
* resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
* request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
*
diff --git a/frontend/src/utils/role.ts b/frontend/src/utils/role.ts
index 07c20423b1..d37b9cc758 100644
--- a/frontend/src/utils/role.ts
+++ b/frontend/src/utils/role.ts
@@ -36,6 +36,8 @@ export const displayRoleTitle = (role: string): string => {
return t("role.project-releaser.self");
case PresetRoleType.SQL_EDITOR_USER:
return t("role.sql-editor-user.self");
+ case PresetRoleType.SQL_EDITOR_READ_USER:
+ return t("role.sql-editor-read-user.self");
case PresetRoleType.GITOPS_SERVICE_AGENT:
return t("role.gitops-service-agent.self");
case PresetRoleType.PROJECT_VIEWER:
@@ -63,6 +65,8 @@ export const displayRoleDescription = (role: string): string => {
return t("role.project-releaser.description");
case PresetRoleType.SQL_EDITOR_USER:
return t("role.sql-editor-user.description");
+ case PresetRoleType.SQL_EDITOR_READ_USER:
+ return t("role.sql-editor-read-user.description");
case PresetRoleType.GITOPS_SERVICE_AGENT:
return t("role.gitops-service-agent.description");
case PresetRoleType.PROJECT_VIEWER:
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 0579c88e03..780759aad6 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -17263,9 +17263,9 @@ components:
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
- resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ resource.schema_name: the schema name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ resource.table_name: the table name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index b809bb7261..b26cf777bf 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -2977,7 +2977,7 @@ Binding associates members with a role and optional conditions.
| members | [string](#string) | repeated | Specifies the principals requesting access for a Bytebase resource. For users, the member should be: user:{email} For groups, the member should be: group:{email} For service accounts, the member should be: serviceAccount:{email} For workload identities, the member should be: workloadIdentity:{email} |
| condition | [google.type.Expr](#google-type-Expr) | | The condition that is associated with this binding, only used in the project IAM policy. If the condition evaluates to true, then this binding applies to the current request. If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-Support variables: resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator. resource.schema_name: the schema name, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator. resource.table_name: the table name, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator. resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support &#34;in&#34; operator. request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`.
+Support variables: resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator. resource.schema_name: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator. resource.table_name: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator. resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support &#34;in&#34; operator. request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`.
For example: resource.database == &#34;instances/local-pg/databases/postgres&#34; &amp;&amp; resource.schema_name in [&#34;public&#34;,&#34;another_schema&#34;] resource.database == &#34;instances/local-pg/databases/bytebase&#34; &amp;&amp; resource.schema_name == &#34;public&#34; &amp;&amp; resource.table_name in [&#34;audit_log&#34;] resource.database == &#34;instances/local-pg/databases/postgres&#34; &amp;&amp; resource.environment_id in [&#34;test&#34;] request.time &lt; timestamp(&#34;2025-04-26T11:24:48.655Z&#34;) |
| parsed_expr | [google.api.expr.v1alpha1.Expr](#google-api-expr-v1alpha1-Expr) | | The parsed expression of the condition. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index f0f190837e..c5337919d5 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -8977,9 +8977,9 @@ If the condition evaluates to false, then this binding does not apply to the cur
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
-resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator.
-resource.schema_name: the schema name, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator.
-resource.table_name: the table name, used by the &#34;roles/sqlEditorUser&#34; role, support &#34;==&#34; operator.
+resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator.
+resource.schema_name: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator.
+resource.table_name: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/sqlEditorReadUser&#34; roles, support &#34;==&#34; operator.
resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support &#34;in&#34; operator.
request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`.
diff --git a/proto/v1/v1/iam_policy.proto b/proto/v1/v1/iam_policy.proto
index 76683614c8..fd7d2fa5fb 100644
--- a/proto/v1/v1/iam_policy.proto
+++ b/proto/v1/v1/iam_policy.proto
@@ -67,9 +67,9 @@ message Binding {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- // resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- // resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ // resource.schema_name: the schema name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
+ // resource.table_name: the table name, used by the "roles/sqlEditorUser" and "roles/sqlEditorReadUser" roles, support "==" operator.
// resource.environment_id: the environment to allow the DDL/DML operation in the SQL Editor, only works for the role with bb.sql.ddl or bb.sql.dml permissions. Support "in" operator.
// request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
//