0

I am implementing a custom Membership Provider and a custom Role Provider. It is working fine. I have a custom database that has all of my users and all of the roles and most of the associations between users and roles. There are a few roles where the code to figure out who is in the role is much more complicated. It sort of needs to be done on a user by user basis and there is no simple way to return a list of all of the users in one of these other roles. So what I am trying to do is add the user to the role at runtime. So when the user logs in I will get most of their roles from the custom Role Provider. However I want to run some additional code at login to check and see if they are also part of these other two roles. If they are then I want to add those two roles to the user sort of "temporarily" - for the session. In other words I want my application to know that they are part of those roles, but I don't want the provider to attempt to persist that back to the underlying database. I hope I have described this correctly.

Am I even thinking about this correctly? Is this the right approach? Can this be done?

Please let me know if this is unclear or doesn't make sense.

Thanks, Corey

Corey Burnett
  • 7,312
  • 10
  • 56
  • 93
  • It sounds like you're trying to make it fit when it won't. Don't bother with the role provider; just do it manually. – Greg Dec 03 '10 at 16:51

1 Answers1

0

It sounds like you started coding before you completed and verified the design. I'd honestly advise you to start again and properly define your roles.

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91