* Some more JSON -> HJSON cleanup

* More work on ACS system conditional matching. Now functional within menus. Still more work to go on various ACS checks themselves.
* Use ACS for new user path: If new user requires activation, they will see 'DONE' then get logged off
This commit is contained in:
Bryan Ashby 2015-11-14 12:22:21 -07:00
parent 03f9ad4789
commit 688e46bc47
9 changed files with 93 additions and 68 deletions

View file

@ -46,24 +46,10 @@ MenuStack.prototype.next = function(cb) {
assert(currentModuleInfo, 'Empty menu stack!');
var menuConfig = currentModuleInfo.instance.menuConfig;
/*
:TODO: next should allow for conditionals based on ACS
next: [
{ acs: "GM[sysops]|U1", next: theNextMenu },
...
]
acsUtil.getAcsConditionMatch(cond, memberName) -> value | undefined
(memberName = "next")
*/
var next;
if(_.isArray(menuConfig.next)) {
next = acsUtil.getConditionalValue(this.client, menuConfig.next, 'next');
console.log('conditional next: ' + next);
if(!next) {
cb(new Error('No matching condition for \'next\'!'));
return;
@ -75,12 +61,12 @@ MenuStack.prototype.next = function(cb) {
return;
}
if(menuConfig.next === currentModuleInfo.name) {
if(next === currentModuleInfo.name) {
cb(new Error('Menu config \'next\' specifies current menu!'));
return;
}
this.goto(menuConfig.next, { }, cb);
this.goto(next, { }, cb);
};
MenuStack.prototype.prev = function(cb) {