Fixed a build error in GrpcApiPermsInterceptor.cs

This commit is contained in:
Toastie 2024-10-11 00:15:57 +13:00
parent 252d15bf1d
commit 2548947c58
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -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}",