From 32e31b91b88985175038a83479a39c401838fbad Mon Sep 17 00:00:00 2001 From: Michal Halabica Date: Thu, 14 Dec 2023 15:59:48 +0100 Subject: [PATCH] Hidden unknown role permissions --- src/GrillBot.App/Actions/Commands/RolesReader.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GrillBot.App/Actions/Commands/RolesReader.cs b/src/GrillBot.App/Actions/Commands/RolesReader.cs index 33e39a17d..7ac3a5ba7 100644 --- a/src/GrillBot.App/Actions/Commands/RolesReader.cs +++ b/src/GrillBot.App/Actions/Commands/RolesReader.cs @@ -123,7 +123,9 @@ private async Task> GetDetailFieldsAsync(IRole role) } } - var perms = role.Permissions.Administrator ? new List { "Administrator" } : role.Permissions.ToList().ConvertAll(o => o.ToString()); + var perms = role.Permissions.Administrator ? + new List { "Administrator" } : + role.Permissions.ToList().Select(o => o.ToString()).Where(o => !ulong.TryParse(o, CultureInfo.InvariantCulture, out _)).ToList(); if (perms.Count > 0) result.Add(CreateField("Permissions", string.Join(", ", perms), false));