private void PostProcess(GDPRContentContext context, GDPRPart part) { // if we should detach items, this is the place if (context.ShouldProcess(part)) { // each version of the item will have their own foreach (var itemVersion in context.AllVersions) { var mlpfs = AllMLPFsFromContent(context, itemVersion); foreach (var mlpf in mlpfs) { Func <ContentItem, bool> shouldRemain = ci => true; if (ShoulDetachAll(context, mlpf)) // remove all? { shouldRemain = ci => false; } else if (ShouldDetachPersonal(context, mlpf)) // remove personal info? { shouldRemain = ci => !ci.Is <GDPRPart>(); } mlpf.Ids = RemainingIds(mlpf, shouldRemain); } } } }
private void Processing( GDPRContentContext context, GDPRPart part, Action<ContentItem, GDPRContentContext> process) { // If there are ContentPickerFields whose selected items we should process, do so if (context.ShouldProcess(part)) { var items = AllItemsToProcessFromAllVersions(context); foreach (var item in items) { if (!context.ChainOfItems.Any(ci => ci.Id == item.Id)) { // We only process the item if it's not alredy being processed in the current processing "chain". // This helps preventing recursion, and propagates information regarding the other items. // Then, the Manager will check whether the process is possible. process(item, context); } } } }
public bool ProcessIsAllowed(GDPRPart part) { return(part != null && ProcessIsAllowed(part.ContentItem)); }
public bool ProcessIsAllowed(GDPRPart part) { return(part != null && !part.IsProtected); }
private void FieldsErasing(EraseContentContext context, GDPRPart part) { Processing(context, part, _contentGDPRManager.Erase); }
private void FieldsAnonymizing(AnonymizeContentContext context, GDPRPart part) { Processing(context, part, _contentGDPRManager.Anonymize); }