Hi, Brenden.
Thank you for your answer.
We will add further information for you.
First, the code is as follows.
protected override void OnInit()
{
base.OnInit();
WorkflowEvents.Publish.After += Workflow_Publish_After;
...
private void UpdateRolandProductOfCultures(WorkflowEventArgs e, ref string logMessage)
{
this.UpdateSelfCulture(e, ref logMessage);
if (e.PublishedDocument.IsDefaultCulture)
{
this.OverrideFromGlobal(e, ref logMessage);
}
}
...
private void OverrideFromGlobal(WorkflowEventArgs e, ref string logMessage)
{
var globalPages = ProductProvider.GetProduct(e.PublishedDocument.NodeGUID, e.PublishedDocument.DocumentCulture, e.PublishedDocument.NodeSiteName);
foreach (var page in globalPages)
{
foreach (Product cultureVersion in page.CultureVersions)
{
if (cultureVersion.IsDefaultCulture)
{
continue;
}
cultureVersion.CheckOut();
cultureVersion.DocumentPublishFrom = page.DocumentPublishFrom;
cultureVersion.DocumentPublishTo = page.DocumentPublishTo;
cultureVersion.Update();
cultureVersion.CheckIn();
cultureVersion.Publish();
}
Then, when we log the contents of MembershipContext.AuthenticatedUser in the Workflow_Publish_After event when it is executed without setting "Publish From", we get the following results.
- MembershipContext.AuthenticatedUser
-- user.Email:(email of admin)
-- user.FullName: Global Administrator
-- user.SiteIndependentPrivilegeLevel:GlobalAdmin
For a scheduled publish, the following results
- MembershipContext.AuthenticatedUser
-- user.Email:
-- user.FullName: Public Anonymous User
-- user.SiteIndependentPrivilegeLevel:None
I got to the point where I was sure I had no privileges, but then I couldn't figure out how to run a scheduled publish with the privileges of a GlobalAdmin.
If so, in a scheduled task you can simply choose there to run the task under a given user. In this case, use a user who has permission to copy pages in the content tree.
In this case, use a user who has permission to copy pages in the content tree.
If so, and you have responded to the above answer, what exactly should I do?