code: func (r *Rule) CheckAndSetDefaults() error {
  	if len(r.Resources) == 0 {
  		return trace.BadParameter("missing resources to match")
  	}
  	if len(r.Verbs) == 0 {
  		return trace.BadParameter("missing verbs")
  	}
  	if len(r.Where) != 0 {
  		parser, err := GetWhereParserFn()(&Context{})
  		if err != nil {
  			return trace.Wrap(err)
  		}
  		_, err = parser.Parse(r.Where)
  		if err != nil {
  			return trace.BadParameter("could not parse 'where' rule: %q, error: %v", r.Where, err)
  		}
  	}
  	if len(r.Actions) != 0 {
  		parser, err := GetActionsParserFn()(&Context{})
  		if err != nil {
  			return trace.Wrap(err)
  		}
  		for i, action := range r.Actions {
  			_, err = parser.Parse(action)
  			if err != nil {
  				return trace.BadParameter("could not parse action %v %q, error: %v", i, action, err)
  			}
  		}
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets defaults for this rule