cancel
Showing results for 
Search instead for 
Did you mean: 

How to grant and revoke Analytic Privileage?

SAPSupport
Employee
Employee
584

How to grant or revoke Analytic Privileges?

------------------------------------------------------------------------------------------------------------------------------------------------
ï’¡Learn more about the SAP Support user and program here.
Cocquerel
Active Contributor
0 Kudos

What about HDI Analytic Privileges ?
I see HDI APIs to grant/revoke roles to users but nothing for Analytic Privileges
See https://help.sap.com/viewer/3823b0f33420468ba5f1cf7f59bd6bd9/2.0.05/en-US/bcd6e27173464d9eb6a5ff9e53...
I suppose a general best practice is to nerver grant Analytic Privileges directly to user but instead, create hdi role that contains Analytic Privileges and related views and then, assign this role to user. Do you confirm ?

CharlesFeng
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks for the comments.

The background of this thread was, a customer wants to know how to grant/revoke STRUCTURED PRIVILEGE.

So, I put it here for reference.

Accepted Solutions (1)

Accepted Solutions (1)

SAPSupport
Employee
Employee

It depends on how the analytic privilege was created, the command varies.

1. if the analytic privilege was created from Content -> <package> -> Analytic Privileges (in HANA Studio)
[GRANT]
CALL GRANT_ACTIVATED_ANALYTICAL_PRIVILEGE ('<analytic_privilege>','<user or role>')

[REVOKE]
CALL REVOKE_ACTIVATED_ANALYTICAL_PRIVILEGE ('<analytic_privilege>','<user or role>')

2. if the analytic privilege was created by command "CREATE STRUCTURED PRIVILEGE..."

[GRANT]
GRANT STRUCTURED PRIVILEGE <privilege_name> TO <grantee>"

[REVOKE]
REVOKE STRUCTURED PRIVILEGE <privilege_name> FROM <grantee>

If you are not sure how the analytic privilege was created, you could check the owner of it.
In general, if the analytic privilege was created from Content -> <package> -> Analytic Privileges (in HANA Studio), the owner of the analytic privilege is _SYS_REPO.
In other cases, the owner could be a normal DB user.

You can check the owner via SQL: select * from ownership where OBJECT_NAME like '%<AP name>%';

CharlesFeng
Product and Topic Expert
Product and Topic Expert
0 Kudos

More information for reference.

Prerequisites for Granting and Revoking Privileges and Roles

Stored Procedures Used to Grant/Revoke Privileges on Activated Repository Objects

GRANT Statement (Access Control)
GRANT STRUCTURED PRIVILEGE <privilege_name> TO <grantee>

REVOKE Statement (Access Control)
REVOKE STRUCTURED PRIVILEGE <privilege_name> FROM <grantee>

ntashiro
Newcomer
0 Kudos

Hello.

CALL GRANT_ACTIVATED_ANALYTICAL_PRIVILEGE ('<analytic_privilege>','<user or role>') seems to work fine.

However, due to deprivation of authority, changing GRANT to REVOKE and executing it seems to result in an error.

CALL REVOKE_ACTIVATED_ANALYTICAL_PRIVILEGE ('<analytic_privilege>','<user or role>')

If you deprive a privilege, do you have any necessary privileges for the user performing the deprivation?

Answers (0)