In CMS 11 we could log in as a user like this
PrincipalInfo.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("Dummy User"), new[] { "Everyone" });
It made sense in scheduled jobs, if it were important that the job had the privilieges as a normal visitor. Even if the job were started manually.
How can this be done in CMS 12? PrincipalInfo.CurrentPrincipal is readonly now.
PrincipalInfo.CurrentPrincipal
Have you tried `IPrincipalAccessor`?
You are correct, Vincent, IPrincipalAccessor was the way to go! I figured it out, but forgot to update this thread.
In CMS 11 we could log in as a user like this
It made sense in scheduled jobs, if it were important that the job had the privilieges as a normal visitor. Even if the job were started manually.
How can this be done in CMS 12?
PrincipalInfo.CurrentPrincipal
is readonly now.