anchor.diff:      catch error:badarg ->
               '_unknown_'
       end.
  -
  -maybe_parse_permission(undefined) ->
  -    undefined;
  -maybe_parse_permission(RawPermission) ->
  -    parse_permission(RawPermission).
   
   parse_permission(RawPermission) ->
       case string:tokens(RawPermission, "!") of
  
positive.code:             handle_get_users_with_domain(Req, DomainAtom, Path)
      end.
  
  handle_get_users_with_domain(Req, DomainAtom, Path) ->
      RawPermission = proplists:get_value("permission", Req:parse_qs()),
      case maybe_parse_permission(RawPermission) of
          error ->
              menelaus_util:reply_json(Req, <<"Malformed permission.">>, 400);
          Permission ->
              handle_get_users_with_domain(Req, DomainAtom, Path, Permission)
      end.
  
  handle_get_users_with_domain(Req, DomainAtom, Path, Permission) ->
      Query = Req:parse_qs(),
      FilteredRoles =
          case Permission of
              undefined -> all;
              _ -> get_roles_by_permission(Permission)
          end,
      case lists:keyfind("pageSize", 1, Query) of
          false ->
              handle_get_all_users(Req, {'_', DomainAtom}, FilteredRoles);
          _ ->
              HasStartFrom = lists:keyfind("startFrom", 1, Query) =/= false,
              menelaus_util:execute_if_validated(
                fun (Values) ->
                        Start =
                            case proplists:get_value(startFrom, Values) of
                                undefined ->
                                    undefined;
                                U ->
                                    {U, proplists:get_value(startFromDomain,
                                                            Values)}
                            end,
                        handle_get_users_page(Req, DomainAtom, Path,
                                              proplists:get_value(pageSize,
                                                                  Values),
                                              Start, Permission, FilteredRoles)
                end, Req, Query, get_users_validators(DomainAtom, HasStartFrom))
      end.
  
  handle_get_users_45(Req) ->
  
negative.code:     {[{skipped, skew_skipped(SkewThis)}, {users, [UserJson(El) || El <- Users]}],
       seed_links([{first, First}, {prev, Prev}, {next, CorrectedNext}, {last, Last}])}.
  
  handle_get_users_page(Req, DomainAtom, Path, Values) ->
      Start =
          case proplists:get_value(startFrom, Values) of
              undefined ->
                  undefined;
              U ->
                  {U, proplists:get_value(startFromDomain, Values)}
          end,
      PageSize = proplists:get_value(pageSize, Values),
      Permission = proplists:get_value(permission, Values),
      Roles = get_roles_for_users_filtering(Permission),
      Passwordless = menelaus_users:get_passwordless(),
  
      {PageSkews, Total} =
          pipes:run(menelaus_users:select_users({'_', DomainAtom}),
                    [filter_out_invalid_roles(),
  