I'm writing a site in ASP.NET MVC that will have user accounts. As the site will be oriented towards discussion, I think I need a system for admins to be able to moderate users, just like we have here, on Stack Overflow. I'd like to be able to put a user into a "suspension", so that they are able to log in to the site (at which point they are greeted with a message, such as, "Your account has been suspended until [DATE]"), but are unable to do the functions that users they would normally be able to do.
What's the best way of implementing this?
I was thinking of creating a "Suspended" role, but the thing is, I have a few different roles for normal users themselves, with different privileges.
Have you ever designed a feature like this before? How should I do it? Thanks in advance.
I think roles is the way to go without writing lots of plumbing code.
Create a role called Active which everyone is a member of by default. Then take users out of that role while they are suspended.
Every action you want to deny to suspended users requires the Active role. Simples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With