powerful-van-10212
11/18/2022, 9:42 PMclass Account implements Namespace {
related: {
accountAdmins: User[]
}
permits = {
read: (ctx: Context) =>
this.related.accountAdmins.includes(ctx.subject)
}
}
If I wanted to list the accounts a user has access to what would be nice would be something like: GET relation-tuples?namespace=Account&relation=read&subjectid=x
But that won't work because the relation here is accountAdmins. I could list by accountAdmins, but that would be pushing the authz logic into clients. I could also do a check for every account, but that is slow. Is there a better way to do this?