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
-
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.
Prepare an Operator and Values Permissions Entity
-
Permission ID column - Which should be marked as a key.
-
ID column - Can contain:
-
User IDs in the format required by your identity provider (email addresses, logon names, or other identifiers). If you are using SAML authentication, this column must contain values in the form defined as your User Attribute / IdpUserID (see Enabling a Custom SAML Identity Provider (Legacy Custom IdP)).
-
User IDs associated with any "technical user" OAuth clients created to consume data via the OData API (see Create an OAuth2.0 Client with a Technical User Purpose).
-
Database user names in the format SPACEID#DBUSER (see Consume Data in Power BI and Other Clients, Tools, and Apps via ODBC/JDBC).
-
Identity provider attributes. If you are defining criteria based on user attribute values, you must, in addition, include an ID Type column that contains the values 0-5 (see Use Identity Provider Attributes as Identifiers in Data Access Controls).
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.
|
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 |
-
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
-
In the side navigation area, select (Data Builder), select a space if necessary, and select New Data Access Control to open the editor.
-
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).
-
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.
-
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.
-
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. -
The tools in the editor toolbar help you work with your object throughout its lifecycle:
Tool
Description
Save your changes to the design-time repository. You can use Save As to create a copy of the object.
Deploy your changes to make them available in the run-time environment.
Export the object to a CSN/JSON file.
Open the Impact and Lineage Analysis graph for the object.
Status
[read-only] Displays the status of the object.
Versions
Open the Version History dialog for the object.
Details
Toggles the display of the Properties panel.