We created an access_policy for tenant_user with default_access: "none". Creates on invoice are now refused, but a tenant_user can still list and read every invoice.
Role still reads an entity after setting default_access: "none"
Common question, written up by the Supero team.
1 answer
default_access: "none" stops writes to entities that have no rule. It doesn't stop reads: an entity with no rule stays readable (the read is logged). To refuse reads, give the entity its own access_rule with can_read: false. Get, list, list-bulk, query, refs and aggregates on it then return 403.
{"name": "tenant-user-invoice-rule", "parent_type": "access_policy", "parent_uuid": "<policy-uuid>",
"entity": "billing:invoice",
"can_create": false, "can_read": false, "can_update": false, "can_delete": false}Write all four flags on every rule. A rule replaces the policy default for its entity, and an omitted flag falls back to the schema default, not to default_access: can_read defaults to true, while create, update and delete default to false. So a rule that leaves out can_read grants read.
Then sign in as that role and check GET /api/v1/crud/{domain}/access-policy/me to confirm the entity shows up as you meant.
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer