sul3
01/23/2024, 9:59 AMvroldanbet
01/23/2024, 10:04 AMBulkCheckPermission
call for a subject over a resource, where you list all the permissions to check.sul3
01/23/2024, 10:05 AMsul3
01/23/2024, 10:21 AMvroldanbet
01/23/2024, 10:23 AMReadRelationships
APIvroldanbet
01/23/2024, 10:24 AMsul3
01/23/2024, 12:24 PMsul3
01/25/2024, 10:31 AM@RestController
@RequestMapping("/get-resources")
public static class ResourceController {
@GetMapping("/{resourceType}")
public String getResources(
@PathVariable String resourceType) {
ManagedChannel channel = ManagedChannelBuilder
.forTarget("localhost:50051")
.usePlaintext()
.build();
BearerToken bearerToken = new BearerToken("customKey");
PermissionsServiceGrpc.PermissionsServiceBlockingStub permissionsService = PermissionsServiceGrpc.newBlockingStub(channel)
.withCallCredentials(bearerToken);
PermissionService.RelationshipFilter filter = PermissionService.RelationshipFilter.newBuilder()
.setResourceType("tutorial/" + resourceType)
.build();
}
}
Basically the idea is that the http endpoint receives the type of resource to list, and afterwards it will use that to retrieve all resources of the given type and retrieve them. Now I have managed to create the code provided above (with a little help from copilot), but I am running into a problem now sending this to the spiceDB service, since I cant seem to figure out what kind of request to use (where to set the filter). Thank you in advancevroldanbet
01/25/2024, 10:46 AMsul3
01/25/2024, 10:49 AM