Analytic Privileges restrict the user to view data for which they authorize. SAP HANA Analytic Privileges is used for Security purpose.
SQL Privileges provide authorization on object level not at a record level, so provide a record or row-level authorization “Analytic Privileges” will be used.
SAP HANA Analytic Privileges are used to provide authorization on below information view –
- Attribute View
- Analytic View
- Calculation View
Now we are going to create an Analytic Privileges and will assign to user “ABHI_TEST”, by this Analytic we restrict the user to view data only for a company with value 1000.
How to create analytic privilege in SAP HANA?
Step 1) Go To Analytic Privileges.
Modelling package (Right Click) –> New -> Analytic Privileges.
Step 2) The New popup appear, Enter Analytic Privileges.
- Enter Analytic Privileges Name / Label.
- Package name is automatically selected.
- Selection option creates new.
In next step Analytic Privileges editor will be displayed for add and edit privileges.
Step 3) Click on ‘OK’ button
Analytic Privileges editor will open as below-
- In General Section name and Label is displayed.
- Click on “Add Button” in Reference Models Section.
- Select Calculation View (CA_FI_LEDGER) which we created earlier.
- Click on Add Button for create validity of privileges.
- Assign Privileges validity.
- Click on Add button for selecting attribute for assign restriction.
- Select Attribute Company.
- Click on the add button to assign a value to attribute for restriction.
- Assign Value by selecting Type / operator and value. Here we want to restrict to user see data of calculation view for the only company (1000).
Validate and Activate Analytic Privileges, an analytic privilege is created in Analytic Privileges folder under Modelling package as below –
Step 4) Assign Analytic Privileges to User “ABHI_TEST”.
“ABHI_TEST” user have privileges to access modelling package. Double click on User “ABHI_TEST” from Security -> Users.
- Select Analytic Privileges tab.
- Click on “+” Button.
- A pop-up for Select Analytic Privileges will be displayed. Enter Name of Analytic Privileges which we have created earlier.
- Select Analytic Privileges.
- Click on Ok Button.
Analytic Privileges is added as below –
Step 5) Deploy this changes in user by clicking deploy button.
A message is displayed as User ‘ABHI_TEST’ changed.
Step-6) Check Analytic Privileges.
Check Assign to user “ABHI_TEST” is working or not and Login to “ABHI_TEST” user by select HANAUSER system as below –
- Select HDB (HANAUSER) Current System and right click.
- Select “Add System with Different User”, and enter User Name/ password for user “ABHI_TEST”.
- A System HDB (ABHI_TEST”) will be added to system list.
ABHI_TEST user has no full access of data of Calculation view created by HANAUSER, as HANAUSER has created analytic privileges for restriction on this calculation view for the company -1000 and assign to ABHI_TEST user.
So, Go to Content Folder -> Select Package -> Calculation View (CA_FI_LEDGER) ->Right Click -> Data Preview.
Data Preview screen will be displayed as below-
Data in calculation view will be restricted for company code– 1000.