Example: Loading Tables without User OVERRIDE Privileges - Analytics Database - Teradata Vantage

Security Administration

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
hjo1628096075471.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
zuy1472246340572
lifecycle
latest
Product Category
Teradata Vantage™

When a user without the OVERRIDE privilege performs an INSERT or UPDATE on an row level security table the system converts the session constraint values, defined as byte(n) in the assigned user constraint, to hex code and loads them into the table.

For example, assume that:

  1. A BYTE(1) non-hierarchical constraint named Countries is defined with these values:
    • USA: 1
    • UK: 2
    • Canada: 3
  2. User U1 is assigned the constraint.
    CONSTRAINT = Countries (USA, UK, Canada)
  3. User U1 defines a table to include the Countries constraint column:
    CREATE TABLE rls_table (x INT, Countries CONSTRAINT);
  4. The security policy defined in the related INSERT UDF does not alter the session constraint for the user.

At logon, the session constraint value for user U1 is calculated by the system as follows:

Constraint Value Bit Position Binary Value
USA:1 1 1
UK:2 2 1
Canada:3 3 1
Not applicable 4 0
5 0
6 0
7 0
8 0

The system evaluates the assigned user constraints and calculates a binary string to represent each set of non-hierarchical values, in the preceding example, 11100000, which translates to the hex string ‘E0’xb.

If user U1 inserts a row into the table rls_tbl, the system automatically enters the calculated hex value ‘E0’xb in the Countries CONSTRAINT column for the table.