How to : required validator based on user role ASP.Net MVC 3

Posted by user70909 on Stack Overflow See other posts from Stack Overflow or by user70909
Published on 2010-12-24T16:56:42Z Indexed on 2010/12/25 4:53 UTC
Read the original article Hit count: 548

Hi, i have a form where i have the field "Real Cost" i want to customize its appearance and wither it should be validated based on user role.

to be more clear is say the client want to show his field in the form or details page and also make it editable for users in Roles "Senior Sales, Manager" but not other roles, so can anyone please guide me of the best way ?

should i write custom required validation based on user in role, and if so can you please provide the right implementation of it?

some may tell me create custom model for this, but i think it would be hassle plus the Roles will be dynamic so it is not predefined set of roles.

i hope i was clear enough

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc