1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #6331: Disable chown for Apps from public market (#2752)

This commit is contained in:
Pavel Czerný 2023-09-25 14:26:18 +02:00 committed by GitHub
parent 2efd976645
commit 5b68006368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -363,6 +363,25 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList,
{
vms = static_cast<VirtualRouter *>(object.get())->get_vms();
}
else if (auth_object == PoolObjectSQL::MARKETPLACEAPP)
{
auto app = static_cast<MarketPlaceApp*>(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 )