History

add canKick to USI, revert constants to production

Stephen Birarda committed 10 years ago

Commit 4cdc9821 parent 39e6ac04 files · +26 −0Browse files

Showing the changes to libraries/script-engine/src/UsersScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/UsersScriptingInterface.cpp+11−0
@@ -13,6 +13,12 @@ · 12 unmodified lines
1313
1414 #include <NodeList.h>
1515
16+UsersScriptingInterface::UsersScriptingInterface() {
17+ // emit a signal when kick permissions have changed
18+ auto nodeList = DependencyManager::get<NodeList>();
19+ connect(nodeList.data(), &LimitedNodeList::canKickChanged, this, &UsersScriptingInterface::canKickChanged);
20+}
21+
1622 void UsersScriptingInterface::ignore(const QUuid& nodeID) {
1723 // ask the NodeList to ignore this user (based on the session ID of their node)
1824 DependencyManager::get<NodeList>()->ignoreNodeBySessionID(nodeID);
@@ -22,3 +28,8 @@ void UsersScriptingInterface::kick(const QUuid& nodeID) { · 3 unmodified lines
2228 // ask the NodeList to kick the user with the given session ID
2329 DependencyManager::get<NodeList>()->kickNodeBySessionID(nodeID);
2430 }
31+
32+bool UsersScriptingInterface::getCanKick() {
33+ // ask the NodeList to return our ability to kick
34+ return DependencyManager::get<NodeList>()->getThisNodeCanKick();
35+}