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