Was wondering if anyone could help. I have created...
# general
d
Was wondering if anyone could help. I have created two relationships so far
Copy code
Group:g1#members@User:u1
Item:i1#viewers@(Group:g1#members)
with the following OPL spec
Copy code
class User implements Namespace { }

class Group implements Namespace {
    related: {
        members: (User | Group)[]; 
    };
}

class Item implements Namespace {
    related: {
        viewers: (User | SubjectSet<Group, "members">)[];
    };

    permits = {
        view: (ctx: Context): boolean => this.related.viewers.includes(ctx.subject),
    };
}
I dont understand the query required to list all the
Items
that
User:u1
can view with the Relationship API & List. Here is an example of the code (Go)
Copy code
rr, _, err := c.r.RelationshipAPI.GetRelationships(ctx).
		Namespace("Item").
		PageSize(10).
		PageToken(""). // can be empty
		Relation("viewers").
		SubjectId("u1"). //
		Execute()