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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

privileges defined in a .xsprivileges file are bound to the package to which the .xsprivileges file belongs<br />

and can only be used in this package and its subpackages.<br />

Inside the .xsprivileges file, a privilege is defined by specifying an entry name with an optional description.<br />

This entry name is then automatically prefixed with the package name to form the unique privilege name, for<br />

example, sap.hana::Execute.<br />

As an application privilege is created during activation of an .xsprivileges file, the only user who has the<br />

privilege by default is the _SYS_REPO user. To grant or revoke the privilege to (or from) other users you must use<br />

the GRANT_APPLICATION_PRIVILEGE or REVOKE_APPLICATION_PRIVILEGE procedure in the _SYS_REPO<br />

schema.<br />

Note: The .xsprivileges file lists the authorization levels that are available for access to an application<br />

package; the .xsaccess file defines which authorization level is assigned to which application package.<br />

The <strong>SAP</strong> <strong>HANA</strong> XS Application-Privileges File<br />

The following example shows the composition and structure of a basic <strong>SAP</strong> <strong>HANA</strong> XS application-<br />

privileges file.<br />

{<br />

"privileges" :<br />

[<br />

{ "name" : "Execute", "description" : "Basic execution<br />

privilege" },<br />

{ "name" : "Admin", "description" : "Administration<br />

privilege" },<br />

]<br />

}<br />

In the example above, if the application-privileges file is located in the application package<br />

sap.hana.xse, then the following privileges are created:<br />

● sap.hana.xse::Execute<br />

● sap.hana.xse::Admin<br />

Note: The privileges defined apply to the package where the .xsprivileges file is located as well<br />

as any packages further down the package hierarchy unless an additional .xsprivileges file is<br />

present, for example, in a subpackage. The privileges do not apply to packages that are not in the<br />

specified package path, for example, sap.hana.app1.<br />

For the example above, the following Grant procedure would be used:<br />

call<br />

"_SYS_REPO"."GRANT_APPLICATION_PRIVILEGE"('"sap.hana.xse::Execute"',<br />

'')<br />

4.4.8 Create an <strong>SAP</strong> <strong>HANA</strong> XS Application Privileges File<br />

The application-privileges (.xssprivileges) file can be used to grant authorization levels for an application, for<br />

example, to start the application or perform administrative actions on an application.<br />

60<br />

P U B L I C<br />

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

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

Setting Up Your Application

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

Saved successfully!

Ooh no, something went wrong!