I am trying to create a custom resolver that I could then use in the customer role filters.
A little context might help make things clear (and maybe there is an alternate way of doing this)
We are using a Users a individual user, but we have the concept of a company where multiple users could be part of that company.
I am trying to create different roles, for instance User and User-Main. While User would only be able to view their “Saved Carts” a User-Main would be able to view all the “Saved Carts” that belong to their company.
After reading around a little, I think a good solution might be to create a custom resolver. Then inside to custom rules I could use
Instead of trying to do a __isLoggedInCompany variable (which we don’t support), you have access to the following variables:
• __requestingApiToken - The API Token being used to authenticate the request.
• __loggedInUserEmail - The authenticated users email address.
• __loggedInUserId - The authenticated users ID.
Since this role would be in relation to the Carts table (assuming for saved carts), you could specify a filter like so: