public Principal(SoftFluent.Samples.GED.Web.Security.Identity identity) : base(identity, GetRoles(identity)) { if (identity == null) { throw new ArgumentNullException("identity"); } }
private static string[] GetRoles(SoftFluent.Samples.GED.Web.Security.Identity identity) { if (identity == null) { return(new string[0]); } string[] roles = new string[identity.User.Roles.Count]; for (int i = 0; i < identity.User.Roles.Count; i++) { roles[i] = identity.User.Roles[i].Role.Name; } return(roles); }