summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/AdminI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/AdminI.cpp')
-rw-r--r--cpp/src/IceGrid/AdminI.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/AdminI.cpp b/cpp/src/IceGrid/AdminI.cpp
index f1e07dee4b4..f5c7586745c 100644
--- a/cpp/src/IceGrid/AdminI.cpp
+++ b/cpp/src/IceGrid/AdminI.cpp
@@ -637,8 +637,15 @@ AdminI::updateObject(const Ice::ObjectPrx& proxy, const ::Ice::Current& current)
}
void
-AdminI::addObjectWithType(const Ice::ObjectPrx& proxy, const string& type, const ::Ice::Current&)
+AdminI::addObjectWithType(const Ice::ObjectPrx& proxy, const string& type, const ::Ice::Current& current)
{
+ const Ice::Identity id = proxy->ice_getIdentity();
+ if(id.category == _database->getInstanceName())
+ {
+ throw DeploymentException("adding object `" + current.adapter->getCommunicator()->identityToString(id) +
+ "' is not allowed");
+ }
+
ObjectInfo info;
info.proxy = proxy;
info.type = type;