mostRestrictive method

RiskLevel mostRestrictive(
  1. RiskLevel other
)

Returns the most-restrictive of this and other (FR-001 edge case: conflicting entries → most-restrictive wins).

Implementation

RiskLevel mostRestrictive(RiskLevel other) {
  if (this == other) return this;
  // admin > confirm > safe
  if (index > other.index) return this;
  return other;
}