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