Butch
12/12/2017, 5:07 PMquery permitViewOrg($user_id: ID!, $node_id: ID!) {
SomeOrganizationExists(filter: {
id: $node_id
users_some: {
id: $user_id
role_in: [ADMIN, SUPER_ADMIN]
}
})
}
This covers it for reading the org they belong to, but limits usage for super adminsmatic
12/12/2017, 5:13 PMAND
filter?matic
12/12/2017, 5:18 PMmatic
12/12/2017, 5:22 PMSomeOrganizationExists
to SomeUserExists
and then make reference to organisations.
Something like this:
query permitViewOrg($user_id: ID!, $node_id: ID!) {
SomeUserExists(filter: {
OR: [{
id: $user_id,
role: SUPER_ADMIN
}, {
id: $user_id,
role: ADMIN,
organizations_some: {
id: $node_id
}
}]
})
}
Butch
12/12/2017, 5:22 PMmatic
12/12/2017, 5:23 PM