Monday, June 27, 2016

SAP Hana Analyrical Privilege Implement Super User


You have a context calculation view and want to implement a super user who has access to all contents in cockpit.


For this purpose you opened an Authorization table with 2 columns (KEY_NAME KEY_VALUE)


Table AUTH_OPINT

KEY_NAME KEY_VALUE
SUPERUSER U1,U2,U3
   


According to this table U1, U2 and U3 are super users.
When you define below sql as dynamic sql

It will return 'SUPERUSER' if current SESSION_USER is a substring of KEY_VALUE ( "U1,U2,U3" ).



'SUPERUSER' =
(
SELECT KEY_NAME FROM YOURSCHEMA.AUTH_OPINT where KEY_NAME = 'SUPERUSER'
and KEY_VALUE like concat(concat('%', SESSION_USER ),'%')
)

No comments:

Post a Comment