How Decisions Work

Instead of scattering role checks across endpoints, protected routes ask HxGuard whether a subject (a user, or a non-human caller like a connector) may perform an action (such as rules.definitions.write or replay.cohorts.run) on an optional resource. The answer is always an explicit decision with a reason.

  request  >  endpoint  >  HxGuard check(subject, action, resource)
                             |- role-backed actions   (action registry: which roles may do it)
                             |- grant-backed actions  (namespace grants, per-resource)
                             |- relationship-backed   (case tuples: owner / assignee / viewer / editor)
                             v
                           Decision(allow, reason)   deny  >  403 + audited SecurityEvent

Relationship-Based Case Access (ReBAC)

Case-level access is decided from stored relationships, written in the same transaction as the case change itself — authorization cannot drift out of sync with case state. A case's owner is its creator; assignees are materialized automatically from the assignment lifecycle; viewers and editors come from explicit shares.

Design intent: the decision backend is a swappable protocol. Today's built-in engine can be replaced by a dedicated authorization store later without rewriting any endpoint — surfaces already speak "subject / action / resource".

Role Privileges Are Configuration, Not Code

A role is a bundle of privileges, and that bundle is editable. Deciding that managers and developers may review risk is a change an administrator makes in Access Groups → Platform Roles — not a code change, a release, and a deploy.

You cannot lock everyone out. A role-level deny revokes for every holder of that role at once, which makes it the fastest route to nobody being able to grant access. HxGuard compares who holds the bootstrap action before the change against who would hold it afterwards, and refuses the edit with a 409 if the answer would be nobody.

Capabilities

🛡
One Decision Path
A single fail-closed check for roles, grants, and relationships — no scattered per-endpoint role logic on migrated surfaces.
🔒
Fail-Closed by Default
Unknown actions and internal errors deny. New capabilities must be explicitly registered before anyone can use them.
📝
Audited Denials
Every deny becomes a security event that survives the request rollback — feeding HxShield's monitoring.
🤝
Case Sharing
Relationship-based case access with viewer/editor shares, anti-probing 404 denials, and relationship-filtered case lists.