28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Implications of Creating Analytic Privileges Using SQL<br />

The <strong>SAP</strong> <strong>HANA</strong> modeler is the recommended method for creating and managing analytic privileges. However, it is<br />

necessary to use SQL to implement those features of analytic privileges not available in the modeler, that is,<br />

dynamic, procedure-based value filters as attribute restrictions.<br />

In the <strong>SAP</strong> <strong>HANA</strong> modeler, analytic privileges are created as design-time repository objects owned by the<br />

technical user _SYS_REPO. They must be activated to become runtime objects available in the database. Analytic<br />

privileges created using SQL statements are activated immediately. However, they are also owned by the<br />

database user who executes the SQL statements. This is the main disadvantage of using SQL to create analytic<br />

privileges. If the database user who created the analytic privilege is deleted, all objects owned by the user will also<br />

be deleted. Therefore, if you are using SQL to create analytic privileges, we recommend that you create a<br />

dedicated database user (that is, a technical user) for this purpose to avoid the potential loss of complex modeled<br />

privileges.<br />

An additional disadvantage of creating analytic privileges using SQL is that these analytic privileges are not in the<br />

<strong>SAP</strong> <strong>HANA</strong> repository and they cannot be transported between different systems.<br />

Granting and Revoking Analytic Privileges<br />

Analytic privileges are granted and revoked as part of user provisioning.<br />

If the analytic privilege was created and activated using the <strong>SAP</strong> <strong>HANA</strong> modeler, the analytic privilege is owned by<br />

the _SYS_REPO user. Therefore, to be able to grant and revoke the analytic privilege, a user needs the privilege<br />

EXECUTE on the procedures GRANT_ACTIVATED_ANALYTICAL_PRIVILEGE and<br />

REVOKE_ACTIVATED_ANALYTICAL_PRIVILEGE respectively.<br />

If the analytic privilege was created using SQL, only the owner (that is, the creator) of the analytic privilege can<br />

grant and revoke it.<br />

Related Links<br />

<strong>SAP</strong> <strong>HANA</strong> Administration <strong>Guide</strong><br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Example: Creating an Analytic Privilege with Dynamic Value Filter<br />

This example shows you how to create an analytic privilege that contains a dynamic procedure-based value filter<br />

and a fixed value filter in the attribute restriction.<br />

Assume you want to restrict access to product data in secured views as follows:<br />

● Users should only see products beginning with ELECTRO, or<br />

● Users should only see products for which they are specifically authorized. This information is contained in the<br />

database table PRODUCT_AUTHORIZATION_TABLE in the schema AUTHORIZATION.<br />

To be able to implement the second filter condition, you need to create a procedure that will determine which<br />

products a user is authorized to see by querying the table PRODUCT_AUTHORIZATION_TABLE.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up Roles and Authorizations<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!