How to implement Variable Role Management in Forms Authentication.
The case is: We are tracking various projects across various stages... A Particular person Emp1007 could be involved in various projects in different roles... Project Lead for Pr001, Beneficiary for Pr002, Associate for Pr003.
There is a page, where in 开发者_Python百科the user will be listed all the projects he is involved in, and can click on a particular project to perform some action on the same. From next screen onwards he must assume the role corresponding to the selected project, until such time, he comes back to the project listing screen.
How do I do this... Trust I made my requirement clear.
Included Later : My situation is the Role of a particular user must be decided on the basis of the Project he chooses... Further the same user will be needed to assign different roles during the same session... Is this possible? if yes, how?
Raja
I think your problem is to assign roles at runtime.
For this you can use Roles
class.
Msdn Document
Roles.AddUserToRole("King","Lead");
Also know that you can read user's roles when your projest listing screen is loaded
string[] userRoles = ((RolePrincipal)User).GetRoles();
精彩评论