public override string[] GetRolesForUser(string username) { Items.User u = Bridge.GetUser(username); if (u != null) { return(u.GetRoles()); } return(new string[0]); }
public override string[] GetRolesForUser(string username) { return(Cache.GetValue(username, (un) => { Items.User u = Bridge.GetUser(username); if (u != null) { return new CachedRoles { Roles = u.GetRoles() ?? new string[0] } } ; return new CachedRoles { Roles = new string[0] }; }).Roles); }