diff --git a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.CreateAgent.cs b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.CreateAgent.cs index ce6512af..d3754a94 100644 --- a/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.CreateAgent.cs +++ b/src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.CreateAgent.cs @@ -1,8 +1,4 @@ -using BotSharp.Abstraction.Agents.Models; -using BotSharp.Abstraction.Functions.Models; -using BotSharp.Abstraction.Repositories; using BotSharp.Abstraction.Tasks.Models; -using BotSharp.Abstraction.Users.Models; using System.IO; using System.Text.RegularExpressions; diff --git a/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs b/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs index 05867cb0..1b883657 100644 --- a/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs +++ b/src/Infrastructure/BotSharp.Core/Plugins/PluginLoader.cs @@ -270,7 +270,7 @@ public class PluginLoader }); } - public List FilterPluginsByRoles(List plugins, string userRole) + public List GetPluginMenuByRoles(List plugins, string userRole) { if (plugins.IsNullOrEmpty()) return plugins; @@ -279,7 +279,7 @@ public class PluginLoader { if (plugin.Roles.IsNullOrEmpty() || plugin.Roles.Contains(userRole)) { - plugin.SubMenu = FilterPluginsByRoles(plugin.SubMenu, userRole); + plugin.SubMenu = GetPluginMenuByRoles(plugin.SubMenu, userRole); filtered.Add(plugin); } } diff --git a/src/Infrastructure/BotSharp.OpenAPI/Controllers/PluginController.cs b/src/Infrastructure/BotSharp.OpenAPI/Controllers/PluginController.cs index da3de2c8..342f39fb 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/Controllers/PluginController.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/Controllers/PluginController.cs @@ -69,7 +69,7 @@ public class PluginController : ControllerBase var userService = _services.GetRequiredService(); var user = await userService.GetUser(_user.Id); - menu = loader.FilterPluginsByRoles(menu, user?.Role); + menu = loader.GetPluginMenuByRoles(menu, user?.Role); menu = menu.OrderBy(x => x.Weight).ToList(); return menu; }