Filter AuthorizeAttribute custom Roles

Hello everyone!

I am writing application and i would like use Filter Authorize. Default attribute [Authorize(Roles="user")] doesnt work becaues I don’t use membership or simplemembership. I just use my database. My question
what method
should I
and put in the
to take concret role from databes
for the logged-patient? Inside database i have tables: Patient, patientInRoles, Roles.


I think, you would need to create the Custom AuthorizeFilter attribute and have a property called Roles inside it. Finally, override
OnAuthorization method to implement your own way of doing it. Return the result with
HttpUnauthorizedResult object.


Leave a Reply