diff --git a/common.js b/common.js index b3da029e..af55c050 100644 --- a/common.js +++ b/common.js @@ -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; } diff --git a/meshctrl.js b/meshctrl.js index f7bb1e86..26ce918d 100644 --- a/meshctrl.js +++ b/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; }