--- title: "Run as" slug: "base-run-as-actor" updated: 2026-03-31T06:39:41Z published: 2026-03-31T06:39:41Z canonical: "docs.lobstersoftware.com/base-run-as-actor" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Run as > [!NOTE] > Event action – Abstract > > Temporarily changes the current login context for one or more event actions. > > > [!TIP] > > Tooltip > > > > - **Usage**: Login parameters (user, role, company) can be selectively overridden to execute a block of event actions in a different login context. > > - **Parameters**: User; role, company; event actions. The [Run as](/v1/docs/en/base-run-as-actor) event action temporarily defines an *alternating login context* (with the characteristics user, role, company) for the execution of a block of event actions. ![images/download/attachments/177911184/image-2024-9-12_15-34-32-version-1-modificationdate-1726148072368-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-12_15-34-32-version-1-modificationdate-1726148072368-api-v2.png) Characteristics not explicitly specified in the configuration are taken from the *previous login context*. The login context originally goes back to either the current interactive session or a [Integration login](/v1/docs/en/base-lobster-data-login-request) defined by the interface. However, the *previous login context* may take into account former uses of [Run as](/v1/docs/en/base-run-as-actor), if they are still applicable in the context of the current use. On one hand, [Run as](/v1/docs/en/base-run-as-actor) can be used to cascade within the same event handling by 'nesting' (see example below). On the other, the *alternating login context* also applies to events that are triggered, for example, via [Dispatch action event](/v1/docs/en/core-dispatch-action-event-actor) in the [Run as](/v1/docs/en/base-run-as-actor) block. This allows a cascade of [Run as](/v1/docs/en/base-run-as-actor) event actions, which may adjust the login context incrementally to span different [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration). The *alternating login context* affects the following aspects during the execution of the event actions in the [Run as](/v1/docs/en/base-run-as-actor) block: - Access permissions (depending on the role used or the interaction of ownership/company and [Company authorizations](/v1/docs/en/base-company-release)). - Return values of rules and value resolvers that directly refer to the session parameters 'user', 'company' and 'role': - [User of session](/v1/docs/en/base-session-user-value)/[User rule](/v1/docs/en/base-user-rule). - [Company of session](/v1/docs/en/base-session-company-account-value)/[Company rule](/v1/docs/en/base-company-rule). - [Role of session](/v1/docs/en/base-session-role-value)/[Role rule](/v1/docs/en/base-role-rule). - Data directly corresponding to these in the return value of [Session information](/v1/docs/en/core-session-information-resolver). - Assignments for the fields: 'Owner' (`ownerId`), 'Created by' (`creatorId`) and 'Last modified by ID' (`lastModifierId`) when creating entities (see following note). **NOTE:** In contrast to *create*, when entities are *changed*, the original login context will always be applied if the 'Last modifier ID' field (`lastModifierId`) is filled in. However, the *alternating login context* applicable in the context of the [Run as](/v1/docs/en/base-run-as-actor) event action is still decisive for the prior check of the a*ccess* authorization for the modification. **CAUTION****:** The following aspects are explicitly not affected by the *alternating login context* in a [Run as](/v1/docs/en/base-run-as-actor) event action: - Locale: The language of the original login with which the current client session was actually started, unchanged as [Current locale](/v1/docs/en/core-current-locale-resolver). - Default time zone: Optional settings for the 'default time zone' are only taken into account by the user account and/or company account of the *original login* (with the status at the time of login!). As soon as the processes triggered within a [Run as](/v1/docs/en/base-run-as-actor) block have been completely processed, the context automatically reverts to the previously valid login context. ## Configuration ![images/download/attachments/177911184/image2021-2-8_16-15-18-version-1-modificationdate-1726147951950-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2021-2-8_16-15-18-version-1-modificationdate-1726147951950-api-v2.png) The **User override**, **Role override**, and **Company override** parameters can optionally be used to selectively override deviations from the *previous login context* by static assignments. In the above example, the role and company are overridden while the user is kept from the *previous login context*. When configuring, only the users, roles and companies for which there is at least read access within the session are available for selection. If the selection in an existing configuration refers to a target that is not available in the current session, it will appear as 'hidden', as shown above for the **Role override** parameter. The existing value can be kept unchanged, replaced by one of the effectively selectable options or even deleted. On the other hand, it is not possible to first deselect and then reselect a 'hidden option' within the same editing session. **NOTE:** Unlike an interactive login process, the [Run as](/v1/docs/en/base-run-as-actor) event action not only omits password entry but also the following checks for the effectively applicable *alternating login context*: - Whether the account selected in the **User override** parameter is 'Active' (see [Users](/v1/docs/en/base-user)) – i.e. available for interactive login – is not checked. - Whether a company or role is explicitly assigned – i.e. available for interactive login – to the user effectively combined with it via the 'Companies' or 'Roles' field (see [Users](/v1/docs/en/base-user)) is not checked. In the [Run as](/v1/docs/en/base-run-as-actor) block below, the **Event actions** parameter can be added via the ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/add(23).svg) icon (see upper screenshot). ## Example An event handling should check during the 'creation' (see [Common action event](/v1/docs/en/core-common-action-event)) of business objects of the [Orders](/v1/docs/en/ord-order) type whether the reference number specified in the reference attribute 'Receipt No.' is already 'on file' in the customer group of the parent company 'Xflow AG'. Depending on whether an order is classified as a duplicate of an already created order, specific further steps are taken, which in the given context can only be reliably executed with the permissions of the 'Super user limited' role. It is important to bear in mind that the currently registered company, at whose instigation a new order is to be created, does not necessarily have the read access to all orders that may be competing with regard to the 'Receipt No.' required for this check. In the given example, this should only be guaranteed for the parent company ('Xflow AG'), from whose perspective the evaluation must therefore be made. | In the example on the right, the [Run as](/v1/docs/en/base-run-as-actor) event action is used to cascade in two stages: - Initially, based on the login context of the existing session, only the role is overridden by the **Role override** 'Super user limited'. --- - In the [Run as](/v1/docs/en/base-run-as-actor) block, another [Run as](/v1/docs/en/base-run-as-actor) event action immediately follows to temporarily override the actually registered company by the parent company 'Xflow AG'. --- - In their context and with reference to the previously claimed 'Super user limited' privileges, in the 'inner' [Run as](/v1/docs/en/base-run-as-actor) block a [Check existence](/v1/docs/en/core-exists-rule) rule is used to search for a match for the value of the typed reference attribute 'Receipt No.' (`RECEIPT_NO`) between the purchase order to be created and all purchase orders visible for the company 'Xflow AG'. --- - The result of the check is determined here within a [Set value](/v1/docs/en/core-set-value-actor) event action by a [Rule value](/v1/docs/en/core-rule-value) value resolver and assigned to a [Variable](/v1/docs/en/core-storage-value) `isDuplicate`. --- - The isDuplicate variable provides the result of the check afterwards (outside the 'inner' [Run as](/v1/docs/en/base-run-as-actor) instance) for a case distinction per [If then else](/v1/docs/en/core-if-then-else-actor) event action (shown collapsed in the image). Within this case distinction, concrete measures are then handled again in the original company context but still with the 'Super user limited' role. | ![images/download/attachments/177911184/image2021-2-8_16-17-8-version-1-modificationdate-1726147951945-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2021-2-8_16-17-8-version-1-modificationdate-1726147951945-api-v2.png) | | --- | --- |