Hi,
I have a documents in this schema
{
"name": "Some Org",
"team": [
{
"email": "useremail1@company.com",
"role": "admin"
},
{
"email": "useremail2@company.com",
"role": "viewer"
}
]
},
{
"name": "Some Org 2",
"team": [
{
"email": "useremail1@company.com",
"role": "viewer"
}
]
}
I want to let the role evaluate to the respective role being viewer or admin for the caller’s email (%%user.data.email) to allow search and insert operations respectively.
Unable to understand how to reach to that point.
For example, if user email matches and has role viewer - allow search but not others.
If the user email matches in list and has role admin - allow inserts and deletes also.
In above example -
useremail1 should be allowed to run inserts in “Some Org” but not in “Some Org 2”.
useremail2 should be allowed to view “Some Org” but not “Some Org 2”, since they are not a member of that org.