Demo Page
Use this interactive sandbox to see role and ownership rules in action.
- Switch between
adminandmember - Toggle whether the invoice belongs to the current user
- See how buttons are enabled/disabled from policy logic
Signed in as member (id: u-1)
Invoice inv-42 is owned by u-1
Example policy represented by this demo
if (user.role === "admin") {
allow("manage", "Invoice");
} else {
allow("update", "Invoice", (invoice) => invoice.ownerId === user.id);
deny("delete", "Invoice");
}