Rasky
Rasky

Reputation: 1

How can i show data of a username (with same role) - APEX

I am using Apex Application, I need to show data depending on the username that is logged in. I have created roles, but I want to only show the data depending on the patient. For example: A patient wants to see his personal data and not all the data of other patients, is this possible to do with PL/SQL?

Upvotes: 0

Views: 120

Answers (1)

Koen Lostrie
Koen Lostrie

Reputation: 18630

You can use the variable APP_USER for that. It contains the username of the logged on user. If the page is public then APP_USER will have value "nobody". Example:

SELECT <columns> 
  FROM <table> 
 WHERE username = :APP_USER;

Note that for sensitive data you might want to look at more robust ways of security your data, like VPD. That also can be used with apex. Rgds Koen

Upvotes: 1

Related Questions