* User.isGroupMember() can now take a string or array of strings to check

* Add WELCOME2.ANS
* Disallow "all" as a username
* Check group membership when switching areas
This commit is contained in:
Bryan Ashby 2015-11-04 23:04:55 -07:00
parent d2866df97f
commit 5bd95255a3
6 changed files with 22 additions and 7 deletions

View file

@ -48,8 +48,18 @@ function User() {
this.isSysOp = this.isRoot; // alias
this.isGroupMember = function(groupName) {
return self.groups.indexOf(groupName) > -1;
this.isGroupMember = function(groupNames) {
if(_.isString(groupNames)) {
groupNames = [ groupNames ];
}
groupNames.forEach(function groupEntry(groupName) {
if(-1 === self.groups.indexOf(groupName)) {
return false;
}
});
return true;
};
this.getLegacySecurityLevel = function() {