anchor.diff:  %%
   %% Full name is free text, except that it must start with nonspace.
   %%
  --define(FULL_NAME_REGEX, "\\S.{0,1022}"). 
  +-define(FULL_NAME_REGEX, "\\S.{0,1022}").
   -define(ANCHOR_REGEX(Regex), "^" ++ Regex ++ "$").
   
   generate_regex(Pattern) ->
  
positive.code: -define(NAME_FIELD, <<"name">>).
  -define(FULL_NAME_FIELD, <<"full_name">>).
  
  -define(VALIDATION_CONSTRAINTS,
          {[ {?NAME_FIELD, {string_match, regex_for(org_name)}},
             {?FULL_NAME_FIELD,  {string_match, regex_for(org_full_name) }}
           ]}).
  
  -define(VALID_KEYS, [?NAME_FIELD, ?FULL_NAME_FIELD]).
  
  
  
  authz_id(#oc_chef_organization{authz_id = AuthzId}) ->
      AuthzId.
  
negative.code: list(#oc_chef_organization{}, CallbackFun) ->
      CallbackFun({list_query(), [], [name]}).
  
  parse_binary_json({Bin, OrgName}) ->
      parse_binary_json(Bin, OrgName);
  parse_binary_json(Bin) ->
      parse_binary_json(Bin, undefined).
  
  parse_binary_json(Bin, OrgName) ->
      Org0 = chef_json:decode_body(Bin),
      Org = chef_object_base:set_default_values(Org0, ?DEFAULT_FIELD_VALUES),
      validate_org(Org, OrgName). %% TODO need action specific version?
  
  validate_org(Org, OrgName) ->
      case ej:valid(validation_constraints(OrgName), Org) of
          ok -> {ok, Org};
          Bad -> throw(Bad)
      end.
  