Skip to content

Commit

Permalink
Fix api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Dec 21, 2024
1 parent 54e8c66 commit 824218f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class ConfigServiceImpl extends ConfigServiceGrpc.ConfigServiceImplBase {
private Collection<GlobalPermissionState> 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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class InstanceServiceImpl extends InstanceServiceGrpc.InstanceServiceImpl
private Collection<InstancePermissionState> 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)))
Expand Down

0 comments on commit 824218f

Please sign in to comment.