From ba9acbc4b90fe5b6930b100e4aa972c9a6b53d96 Mon Sep 17 00:00:00 2001 From: Tim Cowlishaw Date: Mon, 14 Oct 2024 11:41:45 +0200 Subject: [PATCH] remove owner from world map view --- app/views/v0/devices/_world_map_device.jbuilder | 16 +--------------- app/views/v0/devices/_world_map_list.jbuilder | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/views/v0/devices/_world_map_device.jbuilder b/app/views/v0/devices/_world_map_device.jbuilder index 10514a97..bd634745 100644 --- a/app/views/v0/devices/_world_map_device.jbuilder +++ b/app/views/v0/devices/_world_map_device.jbuilder @@ -1,5 +1,3 @@ -local_assigns[:never_authorized] = false unless local_assigns.has_key?(:never_authorized) - json.( device, :id, @@ -11,18 +9,6 @@ json.( :last_reading_at, ) - -authorized = !local_assigns[:never_authorized] && (current_user && (current_user.is_admin? || (device.owner_id && current_user.id == device.owner_id))) - json.merge!(location: device.formatted_location(true)) -json.merge!(hardware: device.hardware(authorized)) - -if device.owner - json.owner do - json.id device.owner.id - json.username device.owner.username - json.url device.owner.url - end -end - +json.merge!(hardware: device.hardware(false)) diff --git a/app/views/v0/devices/_world_map_list.jbuilder b/app/views/v0/devices/_world_map_list.jbuilder index 01bcfe38..d2652dab 100644 --- a/app/views/v0/devices/_world_map_list.jbuilder +++ b/app/views/v0/devices/_world_map_list.jbuilder @@ -1 +1 @@ -json.array! Device.for_world_map(never_authorized ? nil : current_user), partial: 'world_map_device', as: :device, local_assigns: { never_authorized: never_authorized } +json.array! Device.for_world_map(never_authorized ? nil : current_user), partial: 'world_map_device', as: :device