Skip to content

Instantly share code, notes, and snippets.

@gprasant
Created May 11, 2012 17:07
Show Gist options
  • Save gprasant/2661046 to your computer and use it in GitHub Desktop.
Save gprasant/2661046 to your computer and use it in GitHub Desktop.
A user class
public class User
{
public string Name { get; set; }
public string EMail { get; set; }
public string Phone1 { get; set; }
public string Phone2 { get; set; }
public virtual IEnumerable<Permission> Permissions { get; set; }
public User()
{
Permissions = new List<Permission>();
}
public IIdentity Identity{get; set; }
public bool IsInRole(string role)
{
if (this.Permissions.Select(p => p.Name.ToLower()).Contains(role.ToLower()))
return true;
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment