cancel
Showing results for 
Search instead for 
Did you mean: 

SQL syntax to grant application privileges to Catalog roles

0 Kudos

Hi All,

I am working on creation of Catalog Roles. And I need to add the application privilege

sap.hana.admin.cockpit.sysdb::WidgetAccess:sysdbadmin
sap.hana.admin.cockpit.sysdb::SysDBAdmin

to a catalog Role. (I am not talking about repository roles)

and below syntax

GRANT sap.hana.admin.cockpit.sysdb::SysDBAdmin to ZROLE does not work.

For sure something in the syntax is missing, but I am not sure what is correct.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183326
Active Contributor

Hello,

Can you send me a screen of the error.

Also are you trying to use this with a Multiple container system?

Have you tried using the System view to add the application privilege?

0 Kudos

system view works perfect, but I am looking for scripts.

Yes it is multi tenant DB.

since the same set of roles need to developed across 5 tenants, I am looking for these one time scripts.

former_member183326
Active Contributor
0 Kudos

There may be a way of finding the exact SQL in which Studio uses.

So you say the system view works fine, what I would recommend to do it to activate the SQL Trace, then proceed and grant the application privilege view the Studio navigation bar, then deactivate the trace. Open the trace file and check what exact SQL the Studio used to grant the privilege. This should work in theory.

former_member183326
Active Contributor
0 Kudos

try the following
:

GRANT APPLICATION PRIVILEGE "sap.hana.admin.cockpit.sysdb::WidgetAccess:sysdbadmin" TO "ZTESTROLE_AssignAppPrivi";

0 Kudos

SAP DBTech JDBC: [332]: invalid user name: ZTESTRLE_AssignAppPrivi: line 1 col 88 (at pos 87)

This GRANT syntax is to assign privilege to Users directly and not Role.

0 Kudos

thats a good suggestion, I will try this one.

Former Member
0 Kudos

Hi,

you are trying to assign a privilege owner of which is a _SYS_REPO,

you have to call

CALL GRANT_APPLICATION_PRIVILEGE (' "sap.hana.admin.cockpit.sysdb::WidgetAccess:sysdbadmin" ','ZTESTROLE_AssignAppPrivi')

BR

Kairat Alaichiev

Answers (2)

Answers (2)

0 Kudos

https://help.sap.com/saphelp_hanaplatform/helpdata/en/f1/b28c0904cd4b70bebcfa187831b30f/content.htm

Guys thanks for your valuable inputs, if not exact, still they pointed me to the right direction.

Former Member
0 Kudos

pay attention to quotes before and after the privilege name

' "sap.hana.admin.cockpit.sysdb::WidgetAccess:sysdbadmin" '

0 Kudos

Hello Kairat,

Thanks for the statement, but it errors, again this is for assigning Application privilege to User.

error says invalid user ZTESTROLE_AssignAppPrivi