diff --git a/meshuser.js b/meshuser.js index 6e409491..11d1a411 100644 --- a/meshuser.js +++ b/meshuser.js @@ -63,6 +63,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use const SITERIGHT_USERGROUPS = 0x00000100; const SITERIGHT_RECORDINGS = 0x00000200; const SITERIGHT_LOCKSETTINGS = 0x00000400; + const SITERIGHT_ALLEVENTS = 0x00000800; const SITERIGHT_ADMIN = 0xFFFFFFFF; var obj = {}; diff --git a/views/default.handlebars b/views/default.handlebars index d6f8e6b7..359f581c 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -11052,6 +11052,7 @@ x += '

'; x += '

'; x += '

'; + x += '

'; if (x != '') { x += '
'; } x = '
' + x; x += '
'; @@ -11083,6 +11084,10 @@ Q('ua_managerecordings').checked = ((user.siteadmin != 0xFFFFFFFF) && ((user.siteadmin & 512) != 0)); // Manage Recordings QE('ua_managerecordings', !uself && (userinfo.siteadmin & 512)); } + if ((userinfo.siteadmin & 2048) != 0) { + Q('ua_allevents').checked = ((user.siteadmin != 0xFFFFFFFF) && ((user.siteadmin & 2048) != 0)); // View all events + QE('ua_allevents', !uself && (userinfo.siteadmin & 2048)); + } QE('ua_fulladmin', !uself && (userinfo.siteadmin == 0xFFFFFFFF)); QE('ua_serverbackup', !uself && (userinfo.siteadmin == 0xFFFFFFFF)); @@ -11117,6 +11122,7 @@ QE('ua_nomeshcmd', !Q('ua_fulladmin').checked); QE('ua_manageusergroups', !Q('ua_fulladmin').checked); QE('ua_managerecordings', !Q('ua_fulladmin').checked); + QE('ua_allevents', !Q('ua_fulladmin').checked); QE('ua_locksettings', !Q('ua_fulladmin').checked); QE('ua_fileaccessquota', Q('ua_fileaccess').checked && !Q('ua_fulladmin').checked); } @@ -11136,6 +11142,7 @@ if (Q('ua_manageusergroups').checked == true) siteadmin += 256; if (Q('ua_managerecordings').checked == true) siteadmin += 512; if (Q('ua_locksettings').checked == true) siteadmin += 1024; + if (Q('ua_allevents').checked == true) siteadmin += 2048; } var x = { action: 'edituser', id: user._id, siteadmin: siteadmin }; if (isNaN(quota) == false) { x.quota = (quota * 1024); } diff --git a/webserver.js b/webserver.js index bb00ad85..53e5e345 100644 --- a/webserver.js +++ b/webserver.js @@ -3193,9 +3193,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { const user = obj.users[userid]; const subscriptions = [userid, 'server-global']; if (user.siteadmin != null) { - // Allow full site administrators and user managers to get all events. - if ((user.siteadmin == 0xFFFFFFFF) || ((user.siteadmin & 2) != 0)) subscriptions.push('*'); - if ((user.siteadmin & 2) != 0) { + // Allow full site administrators of users with all events rights to see all events. + if ((user.siteadmin == 0xFFFFFFFF) || ((user.siteadmin & 2048) != 0)) { subscriptions.push('*'); } + else if ((user.siteadmin & 2) != 0) { if ((user.groups == null) || (user.groups.length == 0)) { // Subscribe to all user changes subscriptions.push('server-users');