#1624·casbin

[feature] Add lightweight authorization test helpers

Author: nodeceCreated Dec 23, 2025Updated Sep 9, 2026
Labelsenhancement

Background

Testing authorization behavior with Casbin often results in repetitive Enforce assertions with limited failure context.

Proposal

Introduce a small set of authorization test helper functions as an external package.

Example:

go
authztest.AssertAllow(t, e, "alice", "data1", "read")
authztest.AssertDeny(t, e, "bob", "data1", "write")

Design Notes

  • Helpers are thin wrappers around Enforce