]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: role: use the list roles from role svc classes
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 26 Oct 2020 14:53:51 +0000 (15:53 +0100)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 6 Jun 2022 10:49:43 +0000 (16:19 +0530)
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 <abhishek@suse.com>
src/rgw/rgw_role.cc
src/rgw/rgw_role.h

index db4a2435ae7475b01f974cfb2bf6e0b48fabde17..76907103fd5daa815e4f6c07efe3606f3008d640 100644 (file)
@@ -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<rgw::sal::RGWRole>& 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());
index eb97a3e018c4e2b6e1ea04b20e93f7858af3bc3e..fed1bfc67f57604de455430a8778a514dd3abe25 100644 (file)
@@ -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<rgw::sal::RGWRole>& roles,
+                                optional_yield y,
+                                const DoutPrefixProvider *dpp);
 };
 #endif /* CEPH_RGW_ROLE_H */