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.
Step 1) Go To option as below-
Modelling package (Right Click) --> New -> Analytic Privileges.
Step 2) New Analytic Privilege popup appear
- Enter Analytic Privileges Name / Label.
- Package name is automatically selected.
- Selection option creates new.
Click on 'OK' button, in next step Analytic Privileges editor will be displayed for add and edit privileges.
Step 3) 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) Now we are going to 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) Now, we deploy this changes in user by clicking deploy button.
A message is displayed as below –
User 'ABHI_TEST' changed.
Step-6) Check Analytic Privileges Assign to user "ABHI_TEST" is working or not.
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.