Create an "Operator and Values" Data Access Control

You can create data access controls in which criteria are defined as operator and value pairs. Each user can only see the records that fulfill the operator-value pairs she is authorized for in the permissions entity, including support for complex AND and OR combinations.

Prerequisites

To create data access controls, you must have a scoped role that grants you access to a space with the following privileges:
  • Data Warehouse General (-R------) - To access SAP Datasphere.

  • Data Warehouse Data Builder (-R------) - To access the Data Builder.

  • Data Warehouse Data Access Control (CRUD----) - To create, read, update, and delete data access controls.

The DW Space Administrator role template, for example, grants these privileges. For more information, see Privileges and Permissions and Standard Roles Delivered with SAP Datasphere.

Prepare an Operator and Values Permissions Entity

Before creating your data access control, you must have prepared a permissions entity with the following columns:
  • Permission ID column - Which should be marked as a key.

  • ID column - Can contain: This column must be selected as the Identifier Column in your data access control.

    If a user is not associated with any IDs in the permissions entity then they will not see any records in the protected view.

  • Restriction Column - Each restriction per user must have a unique name, and one or more criteria can belong to each restriction. All criteria belonging to a restriction act together as an AND condition. If you have more than one restriction per user then all restrictions act together as an OR condition.

  • Criterion Column - The criteria name must contain only alphanumeric characters and underscores and appears in the Mappings area when a user applies the data access control to their view. It does not need to exactly match a column name, but should guide the user to the column to which it should be mapped.

  • Operator Column - The following operators are supported:

    • ALL (or *) - Provides access to all records. No values required.

    • N (or IS NULL) - Is null. No values required.

    • NN (or NOT NULL) - Is not null. No values required.

    • EQ (or =) - Equal to First Value.

    • NE (or <> or !=) - Not equal to First Value.

    • GT (or >) - Greater than First Value.

    • GE (or >=) - Greater than or equal to First Value.

    • LT (or <) - Less than First Value.

    • LE (or <=) - Less than or equal to First Value.

    • CP (or LIKE) - Contains pattern First Value. Optionally Second Value can be set to an escape character.

      See LIKE Predicate in the SAP HANA Platform documentation.

    • BT (or BETWEEN) - Between First Value and Second Value.

  • First Value Column - This value acts as the first argument or lower bound of the operator.

  • Second Value Column - This value acts as the second argument or upper bound of the operator.

For example:

Permission ID

ID

Restriction

Criterion

Operator

First Value

Second Value

1

bob@acme.com

0

Code

BT

CA

CZ

2

bob@acme.com

0

Type

EQ

1

 

3

bob@acme.com

1

Class

CP

ERR%

 

4

ann@acme.com

0

Admin

ALL

   
Based on these three records:
  • bob will have access to records with a:

    • (restriction 0) - Code between CA and CZ, and having a Type equal to 1, or

    • (restriction 1) - Class beginning with ERR.

  • ann (restriction 0) - will have access to all records thanks to the ALL operator.

Create an "Operator and Values" Data Access Control

  1. In the side navigation area, select (Data Builder), select a space if necessary, and select New Data Access Control to open the editor.

  2. Complete the properties in the General section:

    Property

    Description

    Business Name

    Enter a descriptive name to help users identify the object. This name can be changed at any time.

    Technical Name

    Displays the name used in scripts and code, synchronized by default with the Business Name.

    To override the default technical name, enter a new one in the field. Technical names can contain only alphanumeric characters and underscores.

    Package

    Select the package to which the object belongs.

    Packages are used to group related objects in order to facilitate their transport between tenants. For more information, see Creating Packages to Export.

    Owner

    Enter the name of the person responsible for your data access control.

    Status

    [read-only] Displays the deployment and error status of the object.

    For more information, see Saving and Deploying Objects.

    Deployed On

    [read-only] Displays the date and time of the last deployment.

    Structure

    Select Operator and Values.

    Permissions Entity

    Select the table or view containing your user ids and criteria.

    The permissions entity must match the structure selected in the Structure field. Click the Open in New Tab button to the right of the field to open the entity in its own editor.

    Allow IdP User Attributes as Identifiers

    Enable the use of user attributes to identify users in your permissions tables.

    For more information, see Use Identity Provider Attributes as Identifiers in Data Access Controls.

    Identifier Type Column

    If Allow IdP User Attributes as Identifiers is enabled, select a column containing the values 0-5, which identify the User ID and IdP application custom attributes 1 to 5 respectively as the type of identifier used for the permissions entity record.

    For more information, see Use Identity Provider Attributes as Identifiers in Data Access Controls.

    Identifier Column

    Select a column containing user ids in the format required by your identity provider (email addresses, logon names, or other identifiers).

  3. Complete the properties in the Criteria section:

    Property

    Description

    Restriction Column

    Select the permissions entity column that contains the restriction names.

    Each restriction per user must have a unique name, and one or more criteria can belong to each restriction. All criteria belonging to a restriction act together as an AND condition. If you have more than one restriction per user then all restrictions act together as an OR condition.

    Criterion Column

    Select the permissions entity column that contains the criteria names.

    The criteria name must contain only alphanumeric characters and underscores and appears in the Mappings area when a user applies the data access control to their view. It does not need to exactly match a column name, but should guide the user to the column to which it should be mapped.

    Operator Column

    Select the permissions entity column that contains operators.

    First Value Column

    Select the permissions entity column that contains the lower bound values to apply to the operators.

    This value acts as the first argument or lower bound of the operator.

    Second Value Column

    Select the permissions entity column that contains the upper bound values to apply to the operators.

    This value acts as the second argument or upper bound of the operator.

  4. Use the Available Criteria table to control which criteria should be applied.

    All available criteria are listed in the table and are all selected to be applied by default. To remove a criterion, deselect it in the list.

  5. Click Save and then Deploy to deploy your data access control and make it available for use.

    For information about attaching a data access control to a view, see Apply a Data Access Control to a Graphical or SQL View.
  6. The tools in the editor toolbar help you work with your object throughout its lifecycle:

    Tool

    Description

    (Save)

    Save your changes to the design-time repository. You can use Save As to create a copy of the object.

    See Saving and Deploying Objects.

    (Deploy)

    Deploy your changes to make them available in the run-time environment.

    See Saving and Deploying Objects.

    (Export)

    Export the object to a CSN/JSON file.

    See Exporting Objects to a CSN/JSON File.

    (Impact and Lineage Analysis)

    Open the Impact and Lineage Analysis graph for the object.

    See Impact and Lineage Analysis.

    Status

    [read-only] Displays the status of the object.

    See Saving and Deploying Objects.

    Versions

    Open the Version History dialog for the object.

    See Reviewing and Restoring Object Versions.

    Details

    Toggles the display of the Properties panel.