anchor.diff:  role_to_json({Name, [BucketName]}) ->
       [{role, Name}, {bucket_name, list_to_binary(BucketName)}].
   
  -get_roles_by_permission(Permission) ->
  +filter_roles_by_permission(Permission) ->
       Config = ns_config:get(),
       Roles = menelaus_roles:get_all_assignable_roles(Config),
       filter_roles_by_permission(Config, Permission, Roles).
  
positive.code: 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.
  
  get_user_json(Identity, Props, Passwordless) ->
      Roles = proplists:get_value(roles, Props, []),
  
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, _),
  