Fixed access control check when managing all device groups.

This commit is contained in:
Ylian Saint-Hilaire 2020-07-14 12:10:21 -07:00
parent da5b501192
commit 30f727c32e
2 changed files with 4 additions and 4 deletions

View File

@ -4105,7 +4105,7 @@
if ((mesh == null) || (mesh.links == null)) { return 0; }
// Check if super user
if (userinfo.manageAllDeviceGroups) return 0xFFFFFFFF;
if (userinfo.manageAllDeviceGroups && (userid == userinfo._id)) return 0xFFFFFFFF;
// Check device group link permission
var rights = 0, r = mesh.links[userid];
@ -4141,7 +4141,7 @@
if (mesh.links[userid] != null) { return true; } // User has visilibity thru a direct link
// Check if user user
if (userinfo.manageAllDeviceGroups) return true;
if (userinfo.manageAllDeviceGroups && (userid == userinfo._id)) return true;
// Check permissions thru user groups
var user = null;

View File

@ -12831,7 +12831,7 @@
if ((mesh == null) || (mesh.links == null)) { return 0; }
// Check if super user
if (serverinfo.manageAllDeviceGroups) return 0xFFFFFFFF;
if (serverinfo.manageAllDeviceGroups && (userid == userinfo._id)) return 0xFFFFFFFF;
// Check device group link permission
var rights = 0, r = mesh.links[userid];
@ -12867,7 +12867,7 @@
if (mesh.links[userid] != null) { return true; } // User has visilibity thru a direct link
// Check if user user
if (serverinfo.manageAllDeviceGroups) return true;
if (serverinfo.manageAllDeviceGroups && (userid == userinfo._id)) return true;
// Check permissions thru user groups
var user = null;