FarukBase Gate System
This is auth,access managing system. If one gate decline or noone accept process will fail. When it's pass all gates with one or more accept process will success.
Gates are object/function in this format :
GATE {
IN : f() : Gate ( information, accept, decline , pass , scope )
}
ADD_GATE(GATE)
Adds gate.
BEGIN(token,cmd,args,scope,SUCCESS,DECLINE)
token is data from user.
cmd is command from user. args is argument of command.
success(information) and decline(information) are callback.
scope must contains necessary functions or data for gate.
var information = {
token : token,
cmd : cmd,
args : args,
state : {
accepted : [],
gateIndex : -1
}
};