anchor.diff:  handle_get_roles(Req) ->
       assert_api_can_be_used(),
   
  -    Params = Req:parse_qs(),
  -    RawPermission = proplists:get_value("permission", Params, undefined),
  -
  -    case maybe_parse_permission(RawPermission) of
  -        error ->
  -            menelaus_util:reply_json(Req, <<"Malformed permission.">>, 400);
  -        Permission ->
  -            Filtered = get_roles_by_permission(Permission),
  -            Json = [{role_to_json(Role) ++ Props} || {Role, Props} <- Filtered],
  -            menelaus_util:reply_json(Req, Json)
  -    end.
  +    Query = Req:parse_qs(),
  +    menelaus_util:execute_if_validated(
  +      fun (Values) ->
  +              Permission = proplists:get_value(permission, Values),
  +              Filtered = filter_roles_by_permission(Permission),
  +              Json =
  +                  [{role_to_json(Role) ++ Props} || {Role, Props} <- Filtered],
  +              menelaus_util:reply_json(Req, Json)
  +      end, Req, Query, get_users_or_roles_validators()).
   
   get_user_json(Identity, Props, Passwordless) ->
       Roles = proplists:get_value(roles, Props, []),
  
positive.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, PageSize,
                        Start, Permission, Roles) ->
      Passwordless = menelaus_users:get_passwordless(),
      {PageSkews, Total} =
          pipes:run(menelaus_users:select_users({'_', DomainAtom}),
                    [filter_out_invalid_roles(),
  
negative.code:               end
        end, Name, State).
  
  get_users_or_roles_validators() ->
      [menelaus_util:validate_any_value(permission, _),
       validate_permission(permission, _)].
  
  get_users_page_validators(DomainAtom, HasStartFrom) ->
      [menelaus_util:validate_integer(pageSize, _),
       menelaus_util:validate_range(pageSize, ?MIN_USERS_PAGE_SIZE,
                                    ?MAX_USERS_PAGE_SIZE, _),
  