package serialization

// CasbinSerializer defines methods for serializing and deserializing any Casbin-compatible entity.
type CasbinSerializer[T any] interface {
	// Serialize converts an entity (Role or Permission) into a Casbin policy.
	Serialize(entity *T) ([]any, error)

	// Deserialize converts a Casbin policy into an entity (Role or Permission).
	Deserialize(policy []string) (*T, error)
}
