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.

Secondly, roles created as design-time objects are not directly associated with a database user. They are created<br />

by the technical user _SYS_REPO and granted through the execution of stored procedures. Any user with access<br />

to these procedures can grant and revoke a role. Roles created in runtime are granted directly by the database<br />

user and can only be revoked by the same user. Additionally, if the database user is deleted, all roles that he or she<br />

granted are revoked. As database users correspond to real people, this could impact the implementation of your<br />

authorization concept, for example, if an employee leaves the organization or is on vacation.<br />

Caution: The design-time version of a role in the repository and its activated runtime version should<br />

always contain the same privileges. In particular, additional privileges should not be granted to the<br />

activated runtime version of a role created in the repository. Although there is no mechanism of<br />

preventing a user from doing this, the next time the role is activated in the repository, any changes made<br />

to the role in runtime will be reverted. It is therefore important that the activated runtime version of a role<br />

is not changed in runtime.<br />

12.3.2 Roles as Repository Objects<br />

The repository of the <strong>SAP</strong> <strong>HANA</strong> database consists of packages that contain design-time versions of various<br />

objects. Being a repository object has several implications for a role.<br />

Grantable Privileges<br />

According to the authorization concept of the <strong>SAP</strong> <strong>HANA</strong> database, a user can only grant a privilege to a user<br />

directly or indirectly in a role if the following prerequisites are met:<br />

● The user has the privilege him- or herself<br />

● The user is authorized to grant the privilege to others (WITH ADMIN OPTION or WITH GRANT OPTION)<br />

A user is also authorized to grant SQL object privileges on objects that he or she owns.<br />

The technical user _SYS_REPO is the owner of all objects in the repository, as well as the runtime objects that are<br />

created on activation. This means that when you create a role as a repository object, you can grant the following<br />

privileges:<br />

● Privileges that have been granted to the technical user _SYS_REPO and that _SYS_REPO can grant further.<br />

This is automatically the case for system privileges, package privileges, analytic privileges, and application<br />

privileges. Therefore, all system privileges, package privileges, analytic privileges, and application privileges<br />

can always be granted in modeled roles.<br />

● Privileges on objects that _SYS_REPO owns.<br />

_SYS_REPO owns all activated objects. Object privileges on non-activated runtime objects must be explicitly<br />

granted to _SYS_REPO. It is recommended that you use a technical user to do this to ensure that privileges<br />

are not dropped when the granting user is dropped (for example, because she leaves the company.<br />

The following table summarizes the situation described above:<br />

Privilege Action Necessary to Grant in Repository Role<br />

System privilege None<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. 323

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

Saved successfully!

Ooh no, something went wrong!