Skip to main content
Solved

Post Deferred Call as other user


Forum|alt.badge.img+9
  • Hero (Customer)
  • 59 replies

Hi,

 

We'd like to be able to run Deferred Calls as a different user. I can't find anything to make this work. Is this possible?

Best answer by dsj

Have you tried using Fnd_Session_API.Impersonate_Fnd_User?

Eg:

begin  
  Dbms_Output.put_line('Session user: ' || Fnd_Session_API.Get_Fnd_User);
  IFSAPP.Fnd_Session_API.Impersonate_Fnd_User('NEW_USER_ID');
  Dbms_Output.put_line('Session user changed to: ' || Fnd_Session_API.Get_Fnd_User);
  -- run the job 
  IFSAPP.Fnd_Session_API.Reset_Fnd_User;
  Dbms_Output.put_line('Session user reset to: ' || Fnd_Session_API.Get_Fnd_User);
end;

 

View original
Did this topic help you find an answer to your question?

11 replies

Kasun Balasooriya
Superhero (Employee)
Forum|alt.badge.img+20

Hi,

Can you please elaborate on your requirement please? What do you mean by 

Jur wrote:

We'd like to be able to run Deferred Calls as a different user. 

 

That is

  1. Are you trying to trigger a deferred call from a another user other than the currently logged in user?
  2. Are you trying to trigger a deferred call from a user other than the application owner?

 


Forum|alt.badge.img+9
  • Author
  • Hero (Customer)
  • 59 replies
  • January 10, 2020

Sorry if I was unclear.  I want to trigger a deferred call and run it under a different user the the currently logged in user. So I if I’m logged in as ‘TESTUSER’ I  want to trigger a deferred call and run it under ‘IFSBATCH’.


Kasun Balasooriya
Superhero (Employee)
Forum|alt.badge.img+20

I believe this is not possible. If this is allowed, I think that would spark a security concern as well. Let’s wait for some more comments from the community to confirm. 

However, it would be beneficial to know the business need you are trying to use this implementation as there could be a different way to workaround your issue. 


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 865 replies
  • Answer
  • January 10, 2020

Have you tried using Fnd_Session_API.Impersonate_Fnd_User?

Eg:

begin  
  Dbms_Output.put_line('Session user: ' || Fnd_Session_API.Get_Fnd_User);
  IFSAPP.Fnd_Session_API.Impersonate_Fnd_User('NEW_USER_ID');
  Dbms_Output.put_line('Session user changed to: ' || Fnd_Session_API.Get_Fnd_User);
  -- run the job 
  IFSAPP.Fnd_Session_API.Reset_Fnd_User;
  Dbms_Output.put_line('Session user reset to: ' || Fnd_Session_API.Get_Fnd_User);
end;

 


CallumW
Superhero (Partner)
Forum|alt.badge.img+15
  • Superhero (Partner)
  • 128 replies
  • January 10, 2020

Issue with impersonate user is that you will have to give this level of access to the first user who is performing the action - something which isn’t advised.

 

 


Rusiru Dharmadasa
Superhero (Employee)
Forum|alt.badge.img+19

I also think if your user doesn’t have Impersonate_Fnd_User level privileges, there is no way to do this. That will be a security restriction as Kasun mentioned. 


Forum|alt.badge.img+9
  • Author
  • Hero (Customer)
  • 59 replies
  • January 14, 2020

Thanks for the reactions! I understand the security risks. We are going to have a look if this is a viable option for us.


Forum|alt.badge.img+6
  • Do Gooder (Partner)
  • 35 replies
  • January 15, 2020

Going back to the start, can you elaborate as to why you need to run the deferred jobs as another user?

I’m guessing its a triggered event perhaps?


Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • January 16, 2020

I would have to echo the others as far a security goes.  You can only impersonate once per session and then you would be opening up the first session to the second sessions privileges.  NOT a good option.  Richard asks a good question.  What are you trying to accomplish?

 


Forum|alt.badge.img+9
  • Author
  • Hero (Customer)
  • 59 replies
  • January 16, 2020

We are working on automating the creation of Sales Parts for our Inter-Site setup. Including setting up the correct pricing and thus doing things like cost calculations, etc. The people doing this should only be able to do this for Inter-Site parts. We have created a solution that seems to be working.


Forum|alt.badge.img+6
  • Do Gooder (Partner)
  • 35 replies
  • January 20, 2020

so… top of my head maybe a scheduled job could accomplish this, depending on how often you create parts and how quickly you need them to be created on the inter-sites or using IFS migrations in-house replication functionality…

Which version of IFS are you using, might be able to patch something together for you


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings