Denies
Refuse a permission at a node and everything below it, whatever roles allow.
Overview
Every grant allows: a role held at a node gives its permissions there and at every node below it. A deny is how you take a permission away inside that reach. Use one for an exception, such as every office except one: grant at the region and deny at the office, instead of granting at each office and remembering to grant at the next one when it opens.
A deny names a target, one or more permissions, a node, optional exception roles, and a required reason. For example: refuse documents.view to everyone holding Regional Viewer at Office A, except holders of Compliance, because Office A's files are under legal hold.
How a Deny Is Evaluated
A deny changes the answer to a check, not the roles anyone holds.
Who a Deny Applies To
A deny has exactly one target:
Exceptions
A deny can name up to 20 exception roles. Anyone holding one of them keeps access despite the deny, wherever they hold that role, while that assignment is in effect and the role is active. Use one so the people who manage access are not locked out. A role cannot be the target and an exception of the same deny.
What a Refusal Looks Like
A refusal by a deny names it:
Canopy's API refuses on the next request after a deny is created. For when an API guarded by the SDK sees it, see When a Change Takes Effect.
Who Can Change Denies
Taking access away is a separate act from assigning a role, so it is granted separately.
Next Step
Tell us how we can improve this guide.