Adding Roles and Adding Registrations to Roles

Jul 31, 2013 at 9:48 AM
Hi,

It would really help me if you can put a documentation on how to add roles and view the user's role in the code. I'm trying to restrict access for Admin and Registered Users and I can't seem to figure out how to send that data into the user roles column for the registered user and how to validate user based on that.

If you can please clarify it and help me understand this part, I would really appreciate it.

Kind Regards,
Plague
Coordinator
Jul 31, 2013 at 12:35 PM
Hello Plague,

No problem at all. Will update docs today or tommorow. Will keep you updated.

Regards,
Dmitriy
Aug 1, 2013 at 3:39 AM
Hi Dmitriy,

Thanks a lot. It would really help me resolve my current trouble. Please kindly mention how to retrieve all the roles as well so I can compare current user's role against the ones that were setup.

Additionally, your documentation for "Adding extra information about user" in Codeplex is not available. The link is broken I think. Maybe you can check that too? It's not needed for me right now but I'd like to learn and so would others.

Keep up the good work mate. You did a great job here.

Kind Regards,
Plague
Coordinator
Aug 2, 2013 at 7:42 AM
Hello Plague,

I have added Basic Membership Overview, where you can check all functions that have roles and membership providers. I will add more info regarding your question "I'm trying to restrict access for Admin and Registered Users and I can't seem to figure out how to send that data into the user roles column for the registered user and how to validate user based on that" later today.

Fill free to suggest features that would be good to implement.

Regards,
Dmitriy.
Aug 2, 2013 at 8:11 AM
Hi Dmitriy,

Thanks a lot. It gives me an idea. I guess I should define the roles in Global.asax and then use that during registration.

I think after that, WebSecurity is handled by MVC isn't it? Anyways, looking forward to your documentation.

Meanwhile, I noticed something strange. Wondering if you came across that. I added Extended Single Mongo Membership through NuGet. It has added the reference and the dll in my project. And when I run it, it works fine. But when I published my project, the ExtMongoMembership.dll did not get published into the bin folder. I uploaded the published files only to encounter the yellow screen informing of the dll missing. I uploaded the dll from the bin folder in my project source (not the published bin folder) and the website started to work fine.

This is really strange. All other dlls got published and I didn't have any issues. Curious why only this dll had this problem.

Anyways, Just wanted to keep you informed of this situation. May be a random fluke (dll doesn't appear for any published copies of this project) for this project. Will try on another project and see.

Kind Regards,
Plague
Coordinator
Aug 2, 2013 at 9:34 AM
Thanks Plague,

Hmm that strange. I have published projects that are usingthis membership dozen times, and cant reproduce. Will take a look at this

Regards,
Dmitriy
Coordinator
Aug 2, 2013 at 9:43 AM
Hello Plague,

"I'm trying to restrict access for Admin and Registered Users and I can't seem to figure out how to send that data into the user roles column for the registered user and how to validate user based on that" - to restrict access you can use attribute [Authorize(Roles="admin, RegisteredRole")] for authorization. Is that helpfull? Or you need any other assistance?

BTW: If you like my project can you please follow me :)

Regards,
Dmitriy.