From 824218fa96b487a652d7a1e523ea271890de0ea8 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:20:36 +0100 Subject: [PATCH] Fix api endpoints --- .../main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java | 1 + .../java/com/soulfiremc/server/grpc/InstanceServiceImpl.java | 1 + 2 files changed, 2 insertions(+) diff --git a/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java b/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java index d5686ec5..5ecd215f 100644 --- a/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java +++ b/server/src/main/java/com/soulfiremc/server/grpc/ConfigServiceImpl.java @@ -41,6 +41,7 @@ public class ConfigServiceImpl extends ConfigServiceGrpc.ConfigServiceImplBase { private Collection getGlobalPermissions() { var user = ServerRPCConstants.USER_CONTEXT_KEY.get(); return Arrays.stream(GlobalPermission.values()) + .filter(permission -> permission != GlobalPermission.UNRECOGNIZED) .map(permission -> GlobalPermissionState.newBuilder() .setGlobalPermission(permission) .setGranted(user.hasPermission(PermissionContext.global(permission))) diff --git a/server/src/main/java/com/soulfiremc/server/grpc/InstanceServiceImpl.java b/server/src/main/java/com/soulfiremc/server/grpc/InstanceServiceImpl.java index f3dbdeb8..738dd555 100644 --- a/server/src/main/java/com/soulfiremc/server/grpc/InstanceServiceImpl.java +++ b/server/src/main/java/com/soulfiremc/server/grpc/InstanceServiceImpl.java @@ -41,6 +41,7 @@ public class InstanceServiceImpl extends InstanceServiceGrpc.InstanceServiceImpl private Collection getInstancePermissions(UUID instanceId) { var user = ServerRPCConstants.USER_CONTEXT_KEY.get(); return Arrays.stream(InstancePermission.values()) + .filter(permission -> permission != InstancePermission.UNRECOGNIZED) .map(permission -> InstancePermissionState.newBuilder() .setInstancePermission(permission) .setGranted(user.hasPermission(PermissionContext.instance(permission, instanceId)))