Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Support for Account approval proccess #632

Open
christianacca opened this issue Apr 16, 2016 · 3 comments
Open

Support for Account approval proccess #632

christianacca opened this issue Apr 16, 2016 · 3 comments
Assignees

Comments

@christianacca
Copy link
Collaborator

christianacca commented Apr 16, 2016

Hi Brok, I've been trying to add an account approval process. I think MR needs an enhancement that I'm about to add if OK with you.

Problem

There's no way to distinguish between when an account is locked or that the account is unapproved.

ie UserAccount.IsLoginAllowed is being overloaded with multiple meanings.

Scenario

Just to be clear here's the use case:

  • User registers for a new account
  • Admin user reviews the new account and decides to either approve or reject new account

Solution

  • Add an UserAccount.IsAccountApproved flag
  • Add an MembershipRebootConfiguration.RequireAccountApproval flag
    • defaults to false for backwards compatibility
  • Deny authentication (and sign in) when !IsAccountApproved && RequireAccountApproval
  • Add ApproveAccount and RejectAccount methods to UserAccountService
    • sets IsAccountApproved
    • raises corresponding events
@christianacca
Copy link
Collaborator Author

MembershipRebootConfiguration.AllowLoginAfterAccountCreation is probably the closest thing in MR that currently supports an approval process.

RequireAccountApproval that I propose above would be used instead to prevent the login until the account is approved.

AllowLoginAfterAccountCreation would need to obsoleted to allow a period of backward compatibility.

@christianacca
Copy link
Collaborator Author

I would also be tempted to rename IsLoginAllowed -> IsLocked.

I won't of course as it would be a big breaking change. Instead I'll add a summary xml comment to the property:

/// <summary>
/// Returns true when the account is locked
/// </summary>
/// <remarks>
/// An locked account will not be able to sign in
/// </remarks>
public virtual bool IsLoginAllowed { get; protected internal set; }

@christianacca
Copy link
Collaborator Author

christianacca commented Apr 16, 2016

I've submitted the PR: #634

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant