SAP API Management & HANA XS - Part II
Sandro Montemezzani - 06.03.2019Background
A few weeks ago I presented the project in the first part of this blog series. Today we want to implement the core of this scenario: The database.
We will create all users and permissions and prepare the HANA DB for the XSServices.
I have set up a fresh HANA DB instance and logged in via the WEB Portal.
Development User

First, we need a development user. This user has the permissions to create and edit tables and views in a database created for them.
I will name this user COMPANYDATADEV
. This gets granted all *Developer
permissions (All permissions with the Developer
suffix).
Restricted User



Next, we need a user with restricted access to the database. The API Management will later access the database through this user.
For this, we first create two roles:
companydata::read
with a grant for theSELECT
command in theCOMPANYDATADEV
schemacompanydata::write
with grants for theINSERT
,UPDATE
andDELETE
commands in theCOMPANYDATADEV
schema
Then we create the user COMPANYDATAUSER_READONLY
, and assign to them just the created role companydata::read
.
(In this blog series, only read access to the database is covered. To extend the scenario to write access, you would additionally assign the companydata::write
role to the user)
Tables
We won't create the database tables manually, but generate them via HANA CDS Entities. We'll do this in the part about XSServices.
More information about HANA CDS Entities can be found here.
Conclusion
With this we have created a solid foundation: we have a user for editing the database, and a user through which the database can be accessed from the outside.
In the following part, we will set up an OData Service via the XS Services of the HANA DB, and fill the database with the required tables.
- To the previous part: Part I - Intro
- To the next part: Part III - HANA XS - oData Services