Is it possible using the Microsoft Role provider to “temporarily” add a user to a role at runtime?

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.

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?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions