Exemple #1
0
 public Principal(SoftFluent.Samples.GED.Web.Security.Identity identity)
     : base(identity, GetRoles(identity))
 {
     if (identity == null)
     {
         throw new ArgumentNullException("identity");
     }
 }
Exemple #2
0
        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);
        }