cockroachdb / cockroachdb/docs

Feedback: Row-Level Security (RLS) Overview - misc. feedback

Ouverte
#19,607 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
HTML
Étoiles
212
Forks
476
Merge moyen
40 min
PR mergées (30 j)
3

Description

Page: https://cockroachlabs.com/docs/v25.2/row-level-security.html

## What is the reason for your feedback?

[ ] Missing the information I need

[ ] Too complicated

[ ] Out of date

[ ] Something is broken

[X] Other

## Additional details

This is great doc overall! Here are a few points of feedback:

Says:

> Define the hr_department role and employees table, add some data, and grant basic table access:

But more than just the hr_department role is defined so the statement does not match the example code

Example says:

> -- Assume roles 'hr_department' and potentially others exist.

This comment is confusing and does not add value

Example says:

> CREATE TABLE employees (
> id SERIAL PRIMARY KEY,

SERIAL is an anti-pattern; better to use UUID

Ditto for

> CREATE TABLE IF NOT EXISTS invoices (
> invoice_id SERIAL PRIMARY KEY,

Says:

> In this example, we use the CURRENT_USER special form of the function with the same name.

But both this example and the example above use CURRENT_USER (so the above comment should be moved up and reference both examples, not just "this example")

Says:

> **Define how the application sets the tenant ID for the session**
> Each application will need to set the tenant context for the session. In this example, you will use the application_name session variable to pass in a tenant ID that will later be extracted from the variable.

However, this approach increases the cardinality of application names, which can break CockroachDB internal statement statistics. Please use a different approach that does not involve encoding the tenant ID into the application name.

Says:

> **Warning:**
> For multi-tenancy to work correctly, this setting must be reliably managed by the application layer and passed in the connection string.

But the example does not show it being passed in the connection string; the example shows it being set via a session variable.
The comment would be improved if it says that the application name can be specified using either the connection string or the application_name session variable

Jira issue: DOC-13672

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.