code: func validateDelegationCfg(ctx *validation.Context, cfg *admin.DelegationPermissions) {
  	names := stringset.New(0)
  	for i, rule := range cfg.Rules {
  		if rule.Name != "" {
  			if names.Has(rule.Name) {
  				ctx.Errorf("two rules with identical name %q", rule.Name)
  			}
  			names.Add(rule.Name)
  		}
  		validateRule(ctx, fmt.Sprintf("rule #%d: %q", i+1, rule.Name), rule)
  	}
  }
docs: // validateDelegationCfg checks deserialized delegation.cfg.