Set the RunAs user for a piece of content. The run_as_current_user flag only does anything if:

set_run_as(content, run_as, run_as_current_user = FALSE)



an R6 Content item


The RunAs user to use for this content


Whether to run this content as the viewer of the application


a Content object, updated with new details


  • PAM is the authentication method

  • Applications.RunAsCurrentUser is enabled on the server

Also worth noting that the run_as user must exist on the RStudio Connect server (as a linux user) and have appropriate group memberships, or you will get a 400: Bad Request. Set to NULL to use the default RunAs user / unset any current configuration.

To "read" the current RunAs user, use the Content object or get_content() function.