Hey all, I am trying to create a scheduled job that runs an action that requires a user being logged in. From what i can tell the JobRunner runs as a null user and I am having difficulty finding the correct method to impersonate a user to be used while running the command.
Does anyone have an example of what the impersonate code for a service would look like in confluence? I have some experience doing this with JIRA but i cannot find the correct class to do the same in Confluence. Should I be using AbstractServiceCommand, RunAsUserCommand, ConfluenceUserManager, and should the user be “admin” or is there an easier way to assume the service to be run as an admin?
Thanks for any and all feedback!