Skip to content

[feature] Add lightweight authorization test helpers #1624

@nodece

Description

@nodece

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:

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

Design Notes

  • Helpers are thin wrappers around Enforce

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions