Skip to content
Community forum

Role still reads an entity after setting default_access: "none"

SolvedSupero SupportSupero team asked

Common question, written up by the Supero team.

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.

Link

1 answer

Accepted answer
Accepted 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.

json
{"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.

Supero Platform teamSupero team answered
Link

Your answer

Role still reads an entity after setting default_access: "none" | Supero Community