cancel
Showing results for 
Search instead for 
Did you mean: 

XSOData View not logged as end user

former_member603682
Discoverer
0 Kudos

Hi!

I am working with Views in SAP HANA Express Edition.

This is the view code. It has the current user in the output.

I developed a SAPUI5 application that uses xsuaa for authentication, but when exposing the view with XSOData, the user is not the logged one (I logged in with XSA_DEV user). It is a technical user instead.

All the sctructured privileges in my application are not working because the user is not the logged one.

Any idea what could be missing here? I need to identify the current user when using xsodata

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate

Current_user is going to be the HDI Container technical user. If you want the business user you need to select the applicationuser from the session context: https://github.com/SAP/hana-xsa-opensap-hana7/blob/master/xsjs/lib/xsjs/whoAmI.xsjs

former_member603682
Discoverer
0 Kudos

Thanks Thomas! Always saving the day!

Having always the HDI Container technical user as the user that access the database means that for example if I define a Structured Privilege, that privilege will be used always with all application users (for example through XSOData) ?? or is there a way to assign Structured Privileges to certain application users?

Thanks!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The application users are not DB users so you can't assign a DB privilege to them. You always assign that to the HDI technical container. It will be checked for all DB access via that container. However you can filter using attributes assigned to the business users in the XSUAA/External IDP.

Answers (0)