Temporary changes to contextual information for URLs
It is possible to override some of the command context information and execute URL commands within the context of another store, or on behalf of another user.URL commands have the following URL input parameters that allow for this temporary switch in command context:
- forStoreId
- The forStoreId URL input parameter allows you to specify the store ID to be used for this particular URL request. This, in effect, temporarily changes the storeId value in the command context to that of the specified store, but this change is only valid for the duration of the URL command and the resulting view.
- cmdStoreId
- The cmdStoreId URL input parameter allows you to specify the store ID to be used for this particular URL command only. This, in effect, temporarily changes the storeId value in the command context to that of the specified store, but this change is only valid for the duration of the URL command. Unlike the forStoreId parameter, cmdStoreId will not change the storeId for the resulting view.
- forUser
- Both the forUser and forUserId URL input parameters allow you to specify that the command be executed for the specified user, even though the user that is currently logged in may be different. This is particularly useful when a customer service representative needs to assist a customer. For example, the customer service representative is able to update a customer's address information on behalf of that customer, by specifying the customer's user name or user ID by using the URL input parameters. This change in user information is only valid for the duration of the URL request for which it was specified.
- forUserId
- The user represented by forUser or forUserId must be a non-administrator. The user must also be manageable by the administrator that is executing the command. Furthermore, the administrator must play the appropriate role in the current store's organization, or any of its ancestor organizations. The
access control policy that specifies which administrators and commands can use the forUser and forUserId parameters is: BecomeUserCustomerServiceGroupExecutesBecomeUserCmdsResourceGroup. By default, the administrative user must have one of the following roles to perform the forUser or forUserId operation:
- Customer Service Representative
- Customer Service Supervisor
- Seller
- Sales Manager
- Operations Manager
- Site administrator
Related concepts
Administrator authority to act for a registered customer
Command types