title: ASP.Net Identity Role restricted database entries
body: <p>I have been making changes to my project to incorporate ASP.Net Identity.
  Right now I have come to a halt of a specific problem.
  I have a model called Files, and I must be able to add files that only users on a specific role can see.
  Let's say I add a report that is only intended for Developers, Testers and Administrators, but HumanResources and Accounting shouldn't be seeing that entry.</p>
  
  <p>I specified my model like this:</p>
  
  <pre><code>public class FileModel
  {
      [Key]
      [Required]
      public Guid Id { get; set; }
  
      [Required]
      [Display(Name = "File Name")]
      [StringLength(50)]
      public string Name { get; set; }
  
      [StringLength(280)]
      public string Description { get; set; }
  
      [Required]
      public string Filetype { get; set; }
  
      [Required]
      public string Path { get; set; }
  
      [Required]
      [Display(Name = "Allowed Users")]
      public virtual List&lt;IdentityRole&gt; Roles { get; set; }
  }
  </code></pre>
  
  <p>My expectation is that I would be able to add Roles to the file, but even though I specified a List of IdentityRole in the model, the mapping from FileModel and Roles was never created in the database when I migrated it, and there is no mention of Roles in the FileModel table. Is there a better way to approach this problem?</p>