Skip to content

fix(#2810): grant CREATE PSE via default_access_role.hdbrole - #2846

Merged
jung-thomas merged 1 commit into
DEVfrom
feat/2810-hana-aicore-pse-role
Oct 19, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
feat/2810-hana-aicore-pse-role

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Follow-up to #2844. The CREATE PSE grant it added via _grants.hdbgrants failed on DEV deploy (tutorials-db-deployer task, run 20261019-105602):

GRANT "SPARQL QUERY","SPARQL UPDATE","CREATE PSE" TO "AC9753…#OO";
→ invalid role name: CREATE PSE

A system privilege can't be granted through the tutorials-kg-grantor SQL-grantor path (the deployer treats the list entries as roles, and the grantor doesn't hold CREATE PSE WITH ADMIN OPTION anyway).

Correct mechanism (per the @sap/hdi-deploy README)

A role at the exact path src/defaults/default_access_role.hdbrole named default_access_role is special-cased by the HDI Deployer: on deploy it is created by the container object owner (#OO) and granted to the service instance's global access role. A system privilege listed in it is therefore granted by #OO — no external grantor, no .hdbgrants.

Changes

  • db/src/defaults/default_access_role.hdbrole (new) — system_privileges: ["CREATE PSE"]. Path + name are the trigger for the deployer special case.
  • db/src/_grants.hdbgrants — reverted to SPARQL-only (removed the broken CREATE PSE).
  • runbook — B1 rewritten to the default_access_role mechanism; the failed .hdbgrants attempt recorded for posterity.

No .hdinamespace needed (db/src has no real namespace prefix); db/src/.hdiconfig already maps .hdbrole.

Verify after deploy

SELECT PRIVILEGE FROM EFFECTIVE_PRIVILEGES WHERE USER_NAME = CURRENT_USER AND PRIVILEGE = 'CREATE PSE';  -- expect 1 row

Then B2 (PSE + remote source) and B3 (VECTOR_EMBEDDING via TUTORIALS_AICORE). Tier A (built-in NLP) already verified green on DEV.

…grants

The first attempt added CREATE PSE to _grants.hdbgrants under the
tutorials-kg-grantor SQL grantor. That failed on DEV deploy
(20261019-105602): the deployer emitted GRANT "CREATE PSE" TO ...#OO,
which HANA rejects as 'invalid role name' — a system privilege cannot be
granted that way, and the grantor lacks CREATE PSE WITH ADMIN OPTION.

Correct HDI-native mechanism (per the @sap/hdi-deploy README): a role at
the exact path src/defaults/default_access_role.hdbrole named
default_access_role is auto-granted by the container object owner to the
service instance's global access role on deploy — so a system privilege
listed in it is granted by #OO with no external grantor.

- db/src/defaults/default_access_role.hdbrole: new; system_privileges
  [CREATE PSE]. Path + name are the trigger for the deployer special case.
- db/src/_grants.hdbgrants: reverted to SPARQL-only (remove CREATE PSE).
- runbook: B1 rewritten to the default_access_role mechanism + the failed
  hdbgrants attempt recorded.

No .hdinamespace needed (db/src defines no real namespace prefix);
db/src/.hdiconfig already maps .hdbrole.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant