I need to avoid certain group to publish a structure group but I don't know how to get that user to check if belongs to a certaing group. This is the code I have:
public RestrictPublishInStructureGroup()
{
SubScribe();
}
private void SubScribe()
{
EventSystem.SubscribeAsync<StructureGroup, PublishEventArgs>(OnPublicationTargetPublish,EventPhases.Initiated);
}
private void OnPublicationTargetPublish(StructureGroup structureGroup, PublishEventArgs e, EventPhases phase)
{
if (!e.Targets.Where(x => x.Title.ToLower() == pubTargetStaging).Any() && !e.Targets.Where(x => x.Title.ToLower() == pubTargetLive).Any())
return;
switch (structureGroup.Title)
{
case "Home":
break;
case "030 Personeelsinfo":
break;
}
}