code: public boolean hasPolicy(String sec, String ptype, List<String> rule) {
          for (List<String> r : model.get(sec).get(ptype).policy) {
              if (Util.arrayEquals(rule, r)) {
                  return true;
              }
          }
  
          return false;
      }
docs: hasPolicy determines whether a model has the specified policy rule.
  
  @param sec the section, "p" or "g".
  @param ptype the policy type, "p", "p2", .. or "g", "g2", ..
  @param rule the policy rule.
  @return whether the rule exists.