
Shouldn’t the IsInRole check above return true? The method signature is
bool IsInRole(string role);
Could someone give brief explanation why here it is returning false? It seems like something obvious however can’t seem to point out.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It looks like the role is stored in the user data portion of the authentication cookie. But the
IsInRolemethod doesn’t look in it when checking for roles unless you tell it to do so. You may take a look at the following answer for an example of how to do so (in this example I have assumed that the roles are stored in the user data portion of the authentication cookie and separated by a|=> this is done when the user logs in).