structure update

This commit is contained in:
2016-08-09 23:37:25 +02:00
parent 1f8e1fc7cb
commit 19a883c641
10 changed files with 129 additions and 97 deletions

View File

@@ -74,16 +74,18 @@ export class SocketConnection {
let done = plugins.q.defer();
if(this.authenticated){
this.socket.on("function", (dataArg:ISocketRequestDataObject) => {
// check if requested function is available to the socket's scope
let referencedFunction:SocketFunction = this.role.allowedFunctions.find((socketFunctionArg) => {
return socketFunctionArg.name === dataArg.funcName
return socketFunctionArg.name === dataArg.funcCallData.funcName;
});
if(referencedFunction !== undefined){
let localSocketRequest = new SocketRequest({
side:"responding",
originSocketConnection:this,
shortId:dataArg.shortId,
requestData:dataArg
funcCallData:dataArg.funcCallData
});
localSocketRequest
} else {
plugins.beautylog.warn("function not existent or out of access scope");
};