code: func isSentinelValid(sentinel sentinel.Evaluator, basicPolicy string, sp Sentinel) error {
  	// Sentinel not enabled at all, or for this policy.
  	if sentinel == nil {
  		return nil
  	}
  	if sp.Code == "" {
  		return nil
  	}
  
  	// We only allow sentinel code on write policies at this time.
  	if basicPolicy != PolicyWrite {
  		return fmt.Errorf("code is only allowed for write policies")
  	}
  
  	// Validate the sentinel parts.
  	switch sp.EnforcementLevel {
  	case "", "soft-mandatory", "hard-mandatory":
  		// OK
  	default:
  		return fmt.Errorf("unsupported enforcement level %q", sp.EnforcementLevel)
  	}
  	return sentinel.Compile(sp.Code)
  }
docs: // isSentinelValid makes sure the given sentinel block is valid, and will skip
  // out if the evaluator is nil.