public static string ToScopesString(this Scopes scopes) { var list = new List <string>(); if (scopes.HasScope(Scopes.ReadPublic)) { list.Add("read_public"); } if (scopes.HasScope(Scopes.ReadPrivate)) { list.Add("read_private"); } if (scopes.HasScope(Scopes.WritePublic)) { list.Add("write_public"); } if (scopes.HasScope(Scopes.WritePrivate)) { list.Add("write_private"); } return(string.Join(",", list)); }