Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex DataLens
  • DataLens neuroanalyst
    • Overview
    • DataLens roles
    • Access to data rows
  • DataLens Gallery
  • Audit Trails events

In this article:

  • Configuring RLS at the dataset level
  • Configuring RLS at the data source level
  • How to change permissions to a row in a dataset
  1. Access management
  2. Access to data rows

Row-level security (RLS)

Written by
Yandex Cloud
Improved by
Dmitry A.
Updated at September 4, 2026
View in Markdown
  • Configuring RLS at the dataset level
  • Configuring RLS at the data source level
  • How to change permissions to a row in a dataset

RLS (row-level security) enables you to restrict data access for users or user group within a single dataset. For example, you can introduce data access control for different customers.

Warning

  • When using RLS, restrict access to the connection by using the Execute permission. This will prevent changes to row access permissions and restrict access to opening the preview window and creating a new dataset based on the connection.

  • RLS only supports access control for row values.

  • The RLS limits apply to whole rows, not just the fields used to configure access control.

You can introduce row-level access control either in a dataset or a data source.

Configuring RLS at the dataset levelConfiguring RLS at the dataset level

You can control access to any dataset dimension. Each user or user group can be granted permissions for an unlimited number of measure values.

With RLS, a query to a dataset passes through the following filter:

where dimension in (value_1, value_2 ... value_N)

You can configure access to rows from the interface or set the configuration in JSON format:

Interface
JSON
  1. Open the dataset and go to the Fields tab.

  2. For the field you need to configure access to, click or → Access permissions.

  3. In the window that opens, on the Table tab, click Add rule and specify:

    • Who gets the access:

      • Users and groups: Grant access to the specified users and groups. You can use search by name, login, or email.
      • All users: Grant access to all users.
      • User IDs: Control access at data source level.
    • Field value. Grant access to all rows with the specified field value.

    Configuring RLS

    screenshot

  4. To add another rule, repeat the previous step.

  5. Click Save.

  6. Save the dataset.

  1. Open the dataset and go to the Fields tab.

  2. For the field you need to configure access to, click or → Access permissions.

  3. In the window that opens, set the RLS configuration in JSON format on the JSON tab:

    [
      {
        "allowed_value": "sp-21",
        "pattern_type": "value",
        "subject": {
          "subject_id": "ssxiy********",
          "subject_name": "user:ssxiy********",
          "subject_type": "user"
        }
      }
    ]
    

    Where:

    • allowed_value: Grant access to all rows with specified field value. You need to specify the value only if pattern_type is set to value; otherwise, it takes the null value.

    • pattern_type: How to grant the access:

      • value: For the specific field value from the allowed_value field.
      • all: For any field values. In this case, allowed_value must be null.
      • userid: Control access at data source level.
    • subject: Description of the subject getting the access:

      • subject_id: ID of the user or group to grant access to. Specify * if subject_type is set to all or an empty value if it is set to userid.

      • subject_name: Name of the user to grant access to. Specify * if subject_type is set to all or the userid value if it is set to userid.

      • subject_type: Who will get the access:

        • user: Grant acces to a specific user. In this case, you need to specify the user ID and username in subject_id and subject_name, respectively.
        • group: Grant access to a user group. In this case, you need to specify the group ID and group name in subject_id and subject_name, respectively.
        • all: Grant access to all users. In which case you need to specify * in subject_id and subject_name.
        • userid: Control access at data source level.

    You can set multiple rules by describing each one in an object with the specified fields.

  4. Click Save.

  5. Save the dataset.

Configuring RLS at the data source levelConfiguring RLS at the data source level

Configuring RLS at the dataset level requires editing the datatset every time the RLS settings change.

To avoid this, you can move the row-level security logic to the data source side:

  1. Add a new field for storing the DataLens user ID to the source data. All requests to the source will be filtered by this field.

    Use this link to look up your ID. If you need another user's ID, ask them to open the link and send you the ID.

  2. For each source data row, specify the ID of the DataLens user who should get access to this row. If multiple users must have access to the same row, you can move the access control logic to a separate table and join it to the main table at the dataset level.

  3. In the dataset, configure access to the field containing user IDs:

    Interface
    JSON
    1. In the RLS settings window, on the Tables tab, click Add rule.

    2. Select User IDs for the Who has access parameter.

      Configuring RLS by user ID

      screenshot

    3. Click Save.

    1. In the RLS configuration window, set the RLS configuration in JSON format on the JSON tab:

      [
        {
          "allowed_value": null,
          "pattern_type": "userid",
          "subject": {
            "subject_id": "",
            "subject_name": "userid",
            "subject_type": "userid"
          },
        }
      ]
      
    2. Click Save. Access will be granted to users whose IDs are specified in the field.

  4. Save the dataset.

Note

You can transfer the RLS logic to the source side for sources where the data structure can be changed. In Yandex Metrica and AppMetrica, the data structure is closed, so this method is not available.

How to change permissions to a row in a datasetHow to change permissions to a row in a dataset

To configure access permissions to data rows:

In the dataset
In the source
  1. Open the dataset.

  2. Go to the Fields tab.

  3. On the right side of the row, click and select Access permissions.

  4. In the window that opens, set the access permissions for the field:

    Interface
    JSON
    1. On the Table tab, click Add rule and specify the users, groups, or All users and the field value. For example, to configure user access to all rows with the first-company value:

      • Who has access: Select the user.
      • Field values: Enter first-company.
    2. Click Save.

    1. On the JSON tab, set the RLS configuration in JSON format. For example, to configure user access to all rows with the first-company value:

      [
        {
          "allowed_value": "first-company",
          "pattern_type": "value",
          "subject": {
            "subject_id": "ssxiy********",
            "subject_name": "user:ssxiy********",
            "subject_type": "user"
          }
        }
      ]
      
    2. Click Save.

  5. Save the dataset.

  1. In the source, add a field with the DataLens user IDs to use for filtering. You can add this field to a new table and join it using the JOIN operator.

  2. Add a field with user IDs to the dataset:

    • If you added a field to an existing table, go to the Fields tab in the dataset and click Update fields at the top of the screen. The user ID field will appear in the list.
    • If you added a field to a new table, join it using the JOIN operator. To do this, go to the Sources tab in the dataset and drag the new table to the workspace. The table will be automatically linked with the existing table. If required, edit the link between the tables and remove duplicate fields left after the join.
  3. Configure field access permissions:

    1. In the dataset, go to the Fields tab.

    2. Find the field with user IDs. On the right side of the row, click and select Access permissions.

    3. In the window that opens, set the access permissions for the field:

      Interface
      JSON
      1. In the RLS settings window, on the Tables tab, click Add rule.
      2. Select User IDs for the Who has access parameter.
      3. Click Save. Access will be granted to users whose IDs are specified in the field.
      1. In the RLS configuration window, set the RLS configuration in JSON format on the JSON tab:

        [
           {
              "allowed_value": null,
              "pattern_type": "userid",
              "subject": {
              "subject_id": "",
              "subject_name": "userid",
              "subject_type": "userid"
              },
           }
        ]
        
      2. Click Save. Access will be granted to users whose IDs are specified in the field.

  4. Save the dataset.

Example

Let's create a dashboard based on sales data by four regions (West, East, North, and South). Regional managers should only have access to their own data, while the company's CEO, to all data.

  1. Define DataLens user IDs.

  2. In the source, create a table named MANAGER_ID, where the region is mapped to the user ID. If a single ID is associated with multiple regions, add all unique pairs:

    REGION MANAGER_NAME MANAGER_ID
    West Arkady 19287318273912873
    East Vassily 92877912837318927
    North Olga 02993284928374346
    South Dmitry 10836293849237642
    West Maxim 71726123712891283
    East Maxim 71726123712891283
    North Maxim 71726123712891283
    South Maxim 71726123712891283
  3. Open the dataset and add the new table: on the Sources tab, drag the table to the workspace.

  4. Make sure the JOIN is based on the REGION field.

    image

  5. Based on the MANAGER_ID field, customize RLS.

    Interface
    JSON

    image

    image

Each user will only see data for regions they have access to.

To change the access permissions, update the data in the source table.

Was the article helpful?

Previous
Requesting access permissions
Next
Overview
© 2026 Direct Cursus Technology L.L.C.