user_info.type = info.acct_type;
}
- /* Administrator may enforce creating new accounts within their own tenants.
- * The config parameter name is kept due to legacy. */
- if (new_acct_user.tenant.empty() && g_conf->rgw_keystone_implicit_tenants) {
+ /* An upper layer may enforce creating new accounts within their own
+ * tenants. */
+ if (new_acct_user.tenant.empty() && implicit_tenants) {
new_acct_user.tenant = new_acct_user.id;
}
const acl_strategy_t extra_acl_strategy;
const AuthInfo info;
+ const bool implicit_tenants;
virtual void create_account(const rgw_user& acct_user,
RGWUserInfo& user_info) const; /* out */
RemoteApplier(CephContext* const cct,
RGWRados* const store,
acl_strategy_t&& extra_acl_strategy,
- const AuthInfo& info)
+ const AuthInfo& info,
+ const bool implicit_tenants)
: cct(cct),
store(store),
extra_acl_strategy(std::move(extra_acl_strategy)),
- info(info) {
+ info(info),
+ implicit_tenants(implicit_tenants) {
}
uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override;
const rgw::auth::RemoteApplier::AuthInfo info
) const override {
auto apl = rgw::auth::add_sysreq(cct, store, s,
- rgw::auth::RemoteApplier(cct, store, std::move(acl_alg), info));
+ rgw::auth::RemoteApplier(cct, store, std::move(acl_alg), info,
+ false /* no implicit tenants */));
/* TODO(rzarzynski): replace with static_ptr. */
return aplptr_t(new decltype(apl)(std::move(apl)));
}
const rgw::auth::RemoteApplier::AuthInfo info
) const override {
return aplptr_t(
- new rgw::auth::RemoteApplier(cct, store, std::move(acl_alg), info));
+ new rgw::auth::RemoteApplier(cct, store, std::move(acl_alg), info,
+ false /* no implicit tenants */));
}
aplptr_t create_apl_local(CephContext* const cct,
auto apl = \
rgw::auth::add_3rdparty(store, s->account_name,
rgw::auth::add_sysreq(cct, store, s,
- rgw::auth::RemoteApplier(cct, store, std::move(extra_acl_strategy),
- info)));
+ rgw::auth::RemoteApplier(cct, store, std::move(extra_acl_strategy), info,
+ cct->_conf->rgw_keystone_implicit_tenants)));
/* TODO(rzarzynski): replace with static_ptr. */
return aplptr_t(new decltype(apl)(std::move(apl)));
}