Hi <@444996680530657281> , thanks! I do have teh f...
# spicedb
m
Hi @Joey , thanks! I do have teh follwoing code for lookup resources:
Copy code
go
func lookupResources(client *authzed.Client) {

    /*
        looked_up_at:{token:"GgYKBENNQUc="} resource_object_id:"3" permissionship:LOOKUP_PERMISSIONSHIP_HAS_PERMISSION after_result_cursor:{token:"CjEKBENNQUcSAi0xEgExEgASAi0xEgItMRIBMBIBMRoQYTg0YThiOTAzMDE2OGFiYiAB"}
    */

    fmt.Println("--- Lookup Resources ---")

    request := &pb.LookupResourcesRequest{
        ResourceObjectType: "post",
        Subject:            &pb.SubjectReference{Object: &pb.ObjectReference{ObjectType: "user", ObjectId: "*"}},
        Permission:         "read",
    }

    resp, err := client.LookupResources(context.Background(), request)
    if err != nil {
        fmt.Printf("error lookup resources: %+v\n", err)
        return
    }
    /*

     */
    for {
        a, err := resp.Recv()
        if err != nil {
            fmt.Printf("error recv: %+v\n", err)
            return
        }
        fmt.Printf("%+v\n", a)
    }

}
`
Any chance for any method for a wildcard (subjects or object)?
4 Views