/// <summary>
        /// Single point get roles
        /// </summary>
        public static IList<AppleseedRole> GetRoles()
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items[strPortalSettings];
            int portalID = portalSettings.PortalID;
            // [email protected]: 29th May 2004 When retrieving/editing/adding roles or users etc then portalID should be 0 if it is shared
            // But I commented this out as this check is done in UsersDB.GetRoles Anyway
            //if (Config.UseSingleUserBase) portalID = 0;

            IList<AppleseedRole> roles;

            // TODO: figure out if we could persist role Guid in cookies

            //// Create the roles cookie if it doesn't exist yet for this session.
            //if ((HttpContext.Current.Request.Cookies["portalroles"] == null) || (HttpContext.Current.Request.Cookies["portalroles"].Value == string.Empty) || (HttpContext.Current.Request.Cookies["portalroles"].Expires < DateTime.Now))
            //{
            try
            {
                // Get roles from UserRoles table, and add to cookie
                UsersDB accountSystem = new UsersDB();
                MembershipUser u = accountSystem.GetSingleUser(HttpContext.Current.User.Identity.Name, portalSettings.PortalAlias);
                roles = accountSystem.GetRoles(u.Email, portalSettings.PortalAlias);
            }
            catch (Exception exc)
            {
                ErrorHandler.Publish(LogLevel.Error, exc);
                //no roles
                roles = new List<AppleseedRole>();
            }

            //    // Create a string to persist the roles
            //    string roleStr = string.Empty;
            //    foreach ( AppleseedRole role in roles )
            //    {
            //        roleStr += role.Name;
            //        roleStr += ";";
            //    }

            //    // Create a cookie authentication ticket.
            //    FormsAuthenticationTicket ticket = new FormsAuthenticationTicket
            //        (
            //        1,                              // version
            //        HttpContext.Current.User.Identity.Name,     // user name
            //        DateTime.Now,                   // issue time
            //        DateTime.Now.AddHours(1),       // expires every hour
            //        false,                          // don't persist cookie
            //        roleStr                         // roles
            //        );

            //    // Encrypt the ticket
            //    string cookieStr = FormsAuthentication.Encrypt(ticket);

            //    // Send the cookie to the client
            //    HttpContext.Current.Response.Cookies["portalroles"].Value = cookieStr;
            //    HttpContext.Current.Response.Cookies["portalroles"].Path = "/";
            //    HttpContext.Current.Response.Cookies["portalroles"].Expires = DateTime.Now.AddMinutes(1);
            //}
            //else
            //{
            //    // Get roles from roles cookie
            //    FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(HttpContext.Current.Request.Cookies["portalroles"].Value);

            //    //convert the string representation of the role data into a string array
            //    ArrayList userRoles = new ArrayList();

            //    //by Jes
            //    string _ticket = ticket.UserData.TrimEnd(new char[] {';'});
            //    foreach (string role in _ticket.Split(new char[] {';'} ))
            //    {
            //        userRoles.Add(role + ";");
            //    }
            //    roles = (string[]) userRoles.ToArray(typeof(string));
            //}

            return roles;
        }