From 027a78243aacd1d9ccd60234b49e4d54721e8719 Mon Sep 17 00:00:00 2001 From: frytimo Date: Mon, 19 Aug 2024 12:50:08 -0300 Subject: [PATCH] Fix bug where a global profile doesn't show up in the device list (#7103) * Fix bug where a global profile doesn't show up in the device list --- app/devices/devices.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/devices/devices.php b/app/devices/devices.php index 2d298c6bb1..93fefec00d 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -132,8 +132,11 @@ //get the devices profiles $sql = "select * from v_device_profiles "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $domain_uuid; + $sql .= "where true "; + if (!permission_exists('device_profile_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $domain_uuid; + } $device_profiles = $database->select($sql, $parameters, 'all'); unset($sql, $parameters);