Exemplo n.º 1
0
        private void Anonymize(AnonymizeContentContext context)
        {
            Process(context, (ctx, action) => {
                // Invoke Anonymizing handlers before anonymization
                GDPRHandlers.Invoke(handler => handler.Anonymizing(ctx), Logger);

                action(ctx);
                // Do any anonymization operation on the ContentItem object itself

                // Invoke Anonymized handlers after we are done.
                GDPRHandlers.Invoke(handler => handler.Anonymized(ctx), Logger);
            });
        }
Exemplo n.º 2
0
        private void Erase(EraseContentContext context)
        {
            Process(context, (ctx, action) => {
                // Invoke Erasing handlers before erasure
                GDPRHandlers.Invoke(handler => handler.Erasing(ctx), Logger);

                action(ctx);
                // Do any erasure operation on the ContentItem object itself

                // Invoke Erased handlers after we are done.
                GDPRHandlers.Invoke(handler => handler.Erased(ctx), Logger);

                // we will handle the DeleteItemsAfterErasure setting here rather than in a handler
                // because we want to make sure it is the last thing. If we put that in a handler,
                // it may execute "out of order" for something else.
                if (context.GDPRPart // if this were null, we wouldn't even be here
                    ?.TypePartDefinition.Settings.GetModel <GDPRPartTypeSettings>()
                    ?.DeleteItemsAfterErasure == true)
                {
                    // Delete the item
                    _contentManager.Remove(context.ContentItem);
                }
            });
        }