* 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:
14
core/user.js
14
core/user.js
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user