fix: no restriction on type field (#1644)

'type' should not matter if 'full' or 'accounts' is false. Relax the
restriction for 'type'
This commit is contained in:
cyan317
2024-09-11 14:42:25 +01:00
committed by GitHub
parent 293af3f3b0
commit ee6018186e
2 changed files with 7 additions and 16 deletions

View File

@@ -1287,7 +1287,11 @@ isAdminCmd(std::string const& method, boost::json::object const& request)
// https://github.com/XRPLF/rippled/issues/5119
auto const isFieldSet = [&jv](auto const field) { return jv.isMember(field) and jv[field].asBool(); };
if (isFieldSet(JS(full)) or isFieldSet(JS(accounts)) or isFieldSet(JS(type)))
// According to doc
// https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger,
// full/accounts/type are admin only, but type only works when full/accounts are set, so we don't need to check
// type.
if (isFieldSet(JS(full)) or isFieldSet(JS(accounts)))
return true;
}