mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* 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:
parent
d2866df97f
commit
5bd95255a3
6 changed files with 22 additions and 7 deletions
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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue