For site-admins or project-admins only, start impersonating a user based on the userId or email address.
labkey.security.impersonateUser(baseUrl=NULL, folderPath,
userId=NULL, email=NULL)
A string specifying the baseUrl
for the LabKey server.
A string specifying the folderPath
in which to impersonate the user.
The id of the user to be impersonated. Either this or email is required.
The email of the user to be impersonated. Either this or userID is required.
Returns a success message based on a call to labkey.whoAmI
.
Admins may impersonate other users to perform actions on their behalf. Site admins may impersonate any user in any project. Project admins must execute this command in a project in which they have admin permission and may impersonate only users that have access to the project.
To finish an impersonation session use
labkey.security.stopImpersonating
.
# NOT RUN {
library(Rlabkey)
labkey.security.impersonateUser(baseUrl="http://labkey/", folderPath = "/home",
email = "reader@localhost.test"
)
# }
Run the code above in your browser using DataLab