Am not sure if am repeating question but i didn't get exact answer for what am looking for
Am having strongly typed view which i bind from model
//Model
[Required]
public string sample { get; set; }
public bool isAllowed { get; set; }
Am allowing the only particular group of users to edit the sample based on the isAllowed Property
//View
if (Model.isAllowed)
{
@Html.EditorFor(model => model.sample)
}
So now required field works if user is allowed but in other part validation fires there comes my problem.
How do i handle this and disable the required field for the other set of users ?
Or Does MVC have any standard in creating my view for this scenarios ?