diff --git a/src/rm/RequestManagerChown.cc b/src/rm/RequestManagerChown.cc index 6e1100733d9..309f825c292 100644 --- a/src/rm/RequestManagerChown.cc +++ b/src/rm/RequestManagerChown.cc @@ -363,6 +363,25 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList, { vms = static_cast(object.get())->get_vms(); } + else if (auth_object == PoolObjectSQL::MARKETPLACEAPP) + { + auto app = static_cast(object.get()); + + auto market_id = app->get_market_id(); + + auto mpool = Nebula::instance().get_marketpool(); + + auto market = mpool->get_ro(market_id); + + if (market && market->is_public()) + { + att.resp_msg = "App " + to_string(oid) + + ": Changing the ownership for an App from the public Marketplace is not permitted"; + failure_response(INTERNAL, att); + + return; + } + } } if ( object == nullptr )