Skip to Content

Run as User

Overview

Run as User is a configurable option that can be used for Scheduled Events. Scheduled Events usually run as a specific User in Vinyl, such as the Service User. This feature allows a developer to specify the User at run time for each row executed by the Scheduled Event.

Note

This feature is only available for use with Scheduled Events.

How to Configure Run as User

Scheduled Events are associated with a Business Object in Vinyl. For each row returned by the Business Object, the Event is executed against that row. If you want to use the Run as User feature:

  • Add in a User ID column to the Event's Business Object. This column should select valid User ID's of Vinyl Users.
  • Go to the details of the column in the Business Object, and set the column's Usage Type to 'Schedule Impersonation User Id'
  • At this point, when Vinyl executes the Event for each row, it will impersonate the Selected User ID for that when executing the Event. For example, WHO() expressions will return the User information for the impersonated User.

Example Use Case

Assume the client requires a Scheduled Event that executes a REST call against an API, using the current User's credentials for authentication. Using impersonation, the schedule will execute the Event for each Selected User and will impersonate that User for any business logic run by the Event. With this approach, the REST API can be called by the Schedule, but run as a User, which is determined at run time.