add missing rights to meshctrl and meshServerRightsArrayToNumber (#6004)
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
4ba08a96f7
commit
ccf57bee1a
|
@ -334,6 +334,11 @@ module.exports.meshServerRightsArrayToNumber = function (val) {
|
|||
if (r == 'locked') { newAccRights |= 32; }
|
||||
if (r == 'nonewgroups') { newAccRights |= 64; }
|
||||
if (r == 'notools') { newAccRights |= 128; }
|
||||
if (r == 'usergroups') { newAccRights |= 256; }
|
||||
if (r == 'recordings') { newAccRights |= 512; }
|
||||
if (r == 'locksettings') { newAccRights |= 1024; }
|
||||
if (r == 'allevents') { newAccRights |= 2048; }
|
||||
if (r == 'nonewdevices') { newAccRights |= 4096; }
|
||||
}
|
||||
return newAccRights;
|
||||
}
|
||||
|
|
11
meshctrl.js
11
meshctrl.js
|
@ -484,7 +484,7 @@ if (args['_'].length == 0) {
|
|||
console.log(" --realname [name] - Set the real name for this account.");
|
||||
console.log(" --phone [number] - Set the account phone number.");
|
||||
console.log(" --rights [none|full|a,b,c] - Comma separated list of server permissions. Possible values:");
|
||||
console.log(" manageusers,backup,restore,update,fileaccess,locked,nonewgroups,notools,usergroups,recordings,locksettings,allevents");
|
||||
console.log(" manageusers,serverbackup,serverrestore,serverupdate,fileaccess,locked,nonewgroups,notools,usergroups,recordings,locksettings,allevents,nonewdevices");
|
||||
break;
|
||||
}
|
||||
case 'edituser': {
|
||||
|
@ -501,7 +501,7 @@ if (args['_'].length == 0) {
|
|||
console.log(" --realname [name] - Set the real name for this account.");
|
||||
console.log(" --phone [number] - Set the account phone number.");
|
||||
console.log(" --rights [none|full|a,b,c] - Comma separated list of server permissions. Possible values:");
|
||||
console.log(" manageusers,backup,restore,update,fileaccess,locked,nonewgroups,notools,usergroups,recordings,locksettings,allevents");
|
||||
console.log(" manageusers,serverbackup,serverrestore,serverupdate,fileaccess,locked,nonewgroups,notools,usergroups,recordings,locksettings,allevents,nonewdevices");
|
||||
break;
|
||||
}
|
||||
case 'removeuser': {
|
||||
|
@ -1866,11 +1866,11 @@ function serverConnect() {
|
|||
var srights = args.rights.toLowerCase().split(',');
|
||||
if (srights.indexOf('full') != -1) { siteadmin = 0xFFFFFFFF; }
|
||||
if (srights.indexOf('none') != -1) { siteadmin = 0x00000000; }
|
||||
if (srights.indexOf('backup') != -1) { siteadmin |= 0x00000001; }
|
||||
if (srights.indexOf('backup') != -1 || srights.indexOf('serverbackup') != -1) { siteadmin |= 0x00000001; }
|
||||
if (srights.indexOf('manageusers') != -1) { siteadmin |= 0x00000002; }
|
||||
if (srights.indexOf('restore') != -1) { siteadmin |= 0x00000004; }
|
||||
if (srights.indexOf('restore') != -1 || srights.indexOf('serverrestore') != -1) { siteadmin |= 0x00000004; }
|
||||
if (srights.indexOf('fileaccess') != -1) { siteadmin |= 0x00000008; }
|
||||
if (srights.indexOf('update') != -1) { siteadmin |= 0x00000010; }
|
||||
if (srights.indexOf('update') != -1 || srights.indexOf('serverupdate') != -1) { siteadmin |= 0x00000010; }
|
||||
if (srights.indexOf('locked') != -1) { siteadmin |= 0x00000020; }
|
||||
if (srights.indexOf('nonewgroups') != -1) { siteadmin |= 0x00000040; }
|
||||
if (srights.indexOf('notools') != -1) { siteadmin |= 0x00000080; }
|
||||
|
@ -1878,6 +1878,7 @@ function serverConnect() {
|
|||
if (srights.indexOf('recordings') != -1) { siteadmin |= 0x00000200; }
|
||||
if (srights.indexOf('locksettings') != -1) { siteadmin |= 0x00000400; }
|
||||
if (srights.indexOf('allevents') != -1) { siteadmin |= 0x00000800; }
|
||||
if (srights.indexOf('nonewdevices') != -1) { siteadmin |= 0x00001000; }
|
||||
}
|
||||
|
||||
if (args.siteadmin) { siteadmin = 0xFFFFFFFF; }
|
||||
|
|
Loading…
Reference in New Issue