const RGWHTTPArgs& args;
mutable boost::tribool is_system;
mutable std::optional<ACLOwner> effective_owner;
+ mutable std::optional<std::string> effective_tenant;
public:
template <typename U>
}
return DecoratedApplier<T>::get_aclowner();
}
+
+ const std::string& get_tenant() const override {
+ if (effective_tenant) {
+ return *effective_tenant;
+ }
+ return DecoratedApplier<T>::get_tenant();
+ }
+
};
template <typename T>
std::string str = args.sys_get(RGW_SYS_PARAM_PREFIX "uid");
if (!str.empty()) {
effective_owner.emplace();
+
effective_owner->id = parse_owner(str);
if (const auto* uid = std::get_if<rgw_user>(&effective_owner->id); uid) {
throw -EACCES;
}
effective_owner->display_name = user->get_display_name();
- }
+ effective_tenant = uid->tenant;
+ } else if (const auto* id = std::get_if<rgw_account_id>(&effective_owner->id); id) {
+ RGWAccountInfo info;
+ rgw::sal::Attrs attrs;
+ RGWObjVersionTracker objv;
+ int r = driver->load_account_by_id(dpp, null_yield, *id, info, attrs, objv);
+ if (r < 0) {
+ throw -EACCES;
+ }
+ effective_tenant = info.tenant;
+ }
}
}
}