Developer forum

Forum » Development » Cancel user creation in notification

Cancel user creation in notification

Marco Santos
Reply
Hello.

I'm trying to achieve something like this:

    [Subscribe(Dynamicweb.Modules.UserManagement.Notifications.UserOnBeforeSave)]
    public class UserOnBeforeSaveSubscriber : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            if (args == null)
                return;

            Dynamicweb.Modules.UserManagement.UserNotificationArgs userArgs = (Dynamicweb.Modules.UserManagement.UserNotificationArgs)args;

            if (UserIsNotValidInRemoteSystem())
                CancelTheUserCreation();
        }
    }
Is there a way to cancel the user creation process at this stage? If there is how is the end user then notified that the creation failed?

Thanks.

Marco


Replies

 

You must be logged in to post in the forum