Files
rbac/compliance_test.go

20 lines
592 B
Go
Raw Normal View History

package rbac_test
import "code.nochebuena.dev/go/rbac"
// Compile-time contract verification.
//
// These assertions are zero-cost at runtime. A build failure here means a
// method was removed or its signature changed — a breaking change.
// Identity must support immutable enrichment returning a value (not pointer).
var _ interface {
WithTenant(string) rbac.Identity
} = rbac.Identity{}
// PermissionMask must expose Has and Grant with the correct typed signatures.
var _ interface {
Has(rbac.Permission) bool
Grant(rbac.Permission) rbac.PermissionMask
} = rbac.PermissionMask(0)