Friday 2 September 2011

Changing the Userid When Triggering the Subscription PeopleCode

The IntBroker(IB) Class method: SwitchAsyncEventUserContext can be used to change the context of the peoplecode running inside the subscription peoplecode. This has to be used by IB only (Checks are available to validate it) and can only be used for IB events that are fired asynchronously (OnRoute, OnSend, OnNotification, etc.). One use case would be, if someone is submitting a process request from a self-service user id and they do not want to give access to query security to each users who are triggering the message. This method is added in PT 8.50 and is not available for lower tools release.


For more information use: E-IB: User Security required on target db for asynchronous messages in 8.48.0x [ID 654592.1]


PeopleBook definition for this method is as follows:


SwitchAsyncEventUserContext


Syntax
SwitchAsyncEventUserContext(UserID, LanguageCode)
Description
Use the SwitchAsyncEventUserContext method to switch the user context within an Integration Broker asynchronous event
Parameters
UserID
Specify the user ID as a string, to which the context has to be  switched.
LanguageCode
Specify the language code, as a string for the user ID
Returns
A Boolean value: true if the switch user was successful, false otherwise.
Example
&returnValue = %IntBroker.SwitchAsyncEventUserContext(“VP1?, “ENG”);


No comments:

Post a Comment