diff --git a/src/EllieBot/Services/GrpcApiPermsInterceptor.cs b/src/EllieBot/Services/GrpcApiPermsInterceptor.cs index 2cee522..c3a5b47 100644 --- a/src/EllieBot/Services/GrpcApiPermsInterceptor.cs +++ b/src/EllieBot/Services/GrpcApiPermsInterceptor.cs @@ -32,6 +32,8 @@ public sealed partial class GrpcApiPermsInterceptor : Interceptor if (!metadata.ContainsKey("userid")) throw new RpcException(new Status(StatusCode.Unauthenticated, "userid has to be specified")); + var method = context.Method[(context.Method.LastIndexOf('/') + 1)..]; + if (perms.TryGetValue(method, out var perm)) { Log.Information("Required permission for {Method} is {Perm}",