summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-09-23 09:07:36 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-09-23 09:07:36 -0230
commit8d015164305a3bcee5920b4578f8ca32374fdfad (patch)
tree629deed1916c7d643a7da05e702c023767c440d0 /cpp
parentvs2010 build fixes (diff)
downloadice-8d015164305a3bcee5920b4578f8ca32374fdfad.tar.bz2
ice-8d015164305a3bcee5920b4578f8ca32374fdfad.tar.xz
ice-8d015164305a3bcee5920b4578f8ca32374fdfad.zip
ICE-3267 add filter to chat demo
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Glacier2/chat/Server.cpp8
-rw-r--r--cpp/demo/Glacier2/chat/config.glacier25
2 files changed, 10 insertions, 3 deletions
diff --git a/cpp/demo/Glacier2/chat/Server.cpp b/cpp/demo/Glacier2/chat/Server.cpp
index af530badce0..1fdf7016f19 100644
--- a/cpp/demo/Glacier2/chat/Server.cpp
+++ b/cpp/demo/Glacier2/chat/Server.cpp
@@ -8,6 +8,7 @@
// **********************************************************************
#include <Ice/Ice.h>
+#include <IceUtil/IceUtil.h> // For generateUUID.
#include <Glacier2/Glacier2.h>
#include <ChatSessionI.h>
@@ -33,7 +34,8 @@ public:
virtual Glacier2::SessionPrx
create(const string& userId, const Glacier2::SessionControlPrx&, const Ice::Current& current)
{
- return Glacier2::SessionPrx::uncheckedCast(current.adapter->addWithUUID(new ChatSessionI(userId)));
+ Ice::Identity ident = { IceUtil::generateUUID(), "session" };
+ return Glacier2::SessionPrx::uncheckedCast(current.adapter->add(new ChatSessionI(userId), ident));
}
};
@@ -51,14 +53,14 @@ public:
}
Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("ChatServer");
-
+
Glacier2::PermissionsVerifierPtr dpv = new DummyPermissionsVerifierI;
adapter->add(dpv, communicator()->stringToIdentity("ChatSessionVerifier"));
Glacier2::SessionManagerPtr csm = new ChatSessionManagerI;
adapter->add(csm, communicator()->stringToIdentity("ChatSessionManager"));
adapter->activate();
communicator()->waitForShutdown();
-
+
return EXIT_SUCCESS;
}
};
diff --git a/cpp/demo/Glacier2/chat/config.glacier2 b/cpp/demo/Glacier2/chat/config.glacier2
index 119699928c2..df8cf551dd5 100644
--- a/cpp/demo/Glacier2/chat/config.glacier2
+++ b/cpp/demo/Glacier2/chat/config.glacier2
@@ -42,6 +42,11 @@ Glacier2.PermissionsVerifier=ChatSessionVerifier:tcp -h localhost -p 10001
Glacier2.SessionTimeout=30
#
+# Only allow access to back end "sesion" objects.
+#
+Glacier2.Filter.Category.Accept=session
+
+#
# Security Tracing
#
# 0 = no security tracing