From 846a0e4ec96d2e06fe96984d7be20d16bbb80c8f Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 26 Oct 2020 15:53:51 +0100 Subject: [PATCH] rgw: role: use the list roles from role svc classes This keeps the implementation of storage seperate from the RGWRole class. Also drop the get_roles_by_path_prefix static function as this is currently implemented in the backend and can be directly accessed from role ctl classes. Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_role.cc | 16 ++++++++++++++++ src/rgw/rgw_role.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index db4a2435ae7..76907103fd5 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -531,6 +531,22 @@ int RGWRoleCtl::delete_path(const std::string& role_id, }); } +int RGWRoleCtl::list_roles_by_path_prefix(const std::string& path_prefix, + const std::string& tenant, + std::vector& roles, + optional_yield y, + const DoutPrefixProvider *dpp) +{ + return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) { + return svc.role->list_roles_by_path_prefix(op->ctx(), + path_prefix, + tenant, + roles, + y, + dpp); + }); +} + RGWRoleMetadataHandler::RGWRoleMetadataHandler(RGWSI_Role *role_svc) { base_init(role_svc->ctx(), role_svc->get_be_handler()); diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index eb97a3e018c..fed1bfc67f5 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -355,5 +355,11 @@ public: optional_yield y, const DoutPrefixProvider *dpp, const RemoveParams& params = {}); + + int list_roles_by_path_prefix(const std::string& path_prefix, + const std::string& tenant, + std::vector& roles, + optional_yield y, + const DoutPrefixProvider *dpp); }; #endif /* CEPH_RGW_ROLE_H */ -- 2.39.5