USER vs APEX_PUBLIC_USER [message #487245] |
Fri, 24 December 2010 05:21 |
|
axxi
Messages: 3 Registered: December 2010
|
Junior Member |
|
|
Hi All,
I have an existing application and want to give the users an extra APEX access possibility onto their existing Oracle-forms.
Now I have views who filter data depending on the actual user who is logged on.
So in my where-clause of a view : WHERE mytab_colname_username = USER
This works fine in forms, they show only the data for the actual user.
Now in APEX the view returns NO DATA , because the USER variable contains APEX_PUBLIC_USER as value.
I know I can solve this problem by changing all my views with a IN() or NVL() piece ex: WHERE mytab_colname_username = NVL(v('APP_USER'),USER)
But I was wondering is there in apex-authorization or so a way that the system variable USER contains the user that is logged on in APEX and not the APEX_PUBLIC_USER as value so I dont have to change anything on my existing application?
Thanks already for your time!
GR.
Axxi
|
|
|
Re: USER vs APEX_PUBLIC_USER [message #487281 is a reply to message #487245] |
Fri, 24 December 2010 09:53 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi, You can study APEX_UTIL package in Oracle Application Express APIs in Oracle apex Documentation in the unzipped folder of Apex. You should check CREATE_USER Procedure,CREATE_USER_GROUP Procedure, CURRENT_USER_IN_GROUP Function, GET_CURRENT_USER_ID Function,GET_USERNAME Function. You should create your application with Apex Authentication, and handle users with above functions and procedures, populate your mytab_username field with apex computaion or process with &APP_USER. substitution variable. Then in your reports apply the where clause as required. I have maintained user authorization/authenticaion, data access restriction and page items rendering depending on user ID with the above functions and procedures. You try this, it will work.
Regards
Hasan Al Mamun
programmer
Bangladesh Bank
Dhaka, Bangladesh
|
|
|
|
Re: USER vs APEX_PUBLIC_USER [message #487657 is a reply to message #487479] |
Wed, 29 December 2010 07:04 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi, May be you have developed your apex application with Apex authentication scheme. In Oracle Apex any user session is connected to database with APEX_PUBLIC_USER database user. In Forms if you use the variable USER, the connected database user is populated. But that's not the case in Apex. I have not handled the senario as you described. But I think you can solve your problem if you make your authentication with Oracle database authentication in your oracle apex application.
Regards
Hasan Al Mamun
|
|
|
|
|