std::string err_msg;
int ret = rgw::account::list_users(
dpp(), driver, op_state, path_prefix, marker,
- max_entries_specified, max_entries, err_msg,
- stream_flusher, null_yield);
+ max_entries_specified, max_entries, account_root,
+ err_msg, stream_flusher, null_yield);
if (ret < 0) {
cerr << "ERROR: " << err_msg << std::endl;
return -ret;
int list_users(const DoutPrefixProvider* dpp, rgw::sal::Driver* driver,
AdminOpState& op_state, const std::string& path_prefix,
const std::string& marker, bool max_entries_specified,
- int max_entries, std::string& err_msg,
+ int max_entries, bool root_only, std::string& err_msg,
RGWFormatterFlusher& flusher, optional_yield y)
{
int ret = 0;
}
for (const auto& user : listing.users) {
+ if (root_only && user.type != TYPE_ROOT) {
+ continue; // skip non-root users if requested
+ }
encode_json("key", user.user_id, formatter);
}
flusher.flush();
int list_users(const DoutPrefixProvider* dpp, rgw::sal::Driver* driver,
AdminOpState& op_state, const std::string& path_prefix,
const std::string& marker, bool max_entries_specified,
- int max_entries, std::string& err_msg,
+ int max_entries, bool root_only, std::string& err_msg,
RGWFormatterFlusher& flusher, optional_yield y);
} // namespace rgw::account