diff --git a/Service/Security/SecurityContextInitializer.cs b/Service/Security/SecurityContextInitializer.cs index 20c30d35b..f4fbbbdc7 100644 --- a/Service/Security/SecurityContextInitializer.cs +++ b/Service/Security/SecurityContextInitializer.cs @@ -135,15 +135,13 @@ namespace BeWo.Service.Security try { - if (serviceInterface == "IGkvAccountingService" && methodName == "GetFilteredGkvAbrechnungen") + var name = $"BeWo.Service.ServiceContracts.{serviceInterface}"; + var t = Type.GetType(name); + var methodInfo = t.GetMethod(methodName); + var attribute = methodInfo.GetCustomAttribute(); + if (attribute != null) { - var t = typeof(IGkvAccountingService); - var methodInfo = t.GetMethod(methodName); - var attribute = methodInfo.GetCustomAttribute(); - if (attribute != null) - { - return attribute.HasPermission(rights); - } + return attribute.HasPermission(rights); } } catch (Exception e)