cartodb/lib/carto/tracking/validators/layer.rb

15 lines
358 B
Ruby
Raw Normal View History

2020-06-15 10:58:47 +08:00
module Carto
module Tracking
module Validators
module Layer
def check_layer_belongs_to_visualization!
layer = @format.fetch_record!(:layer)
unless layer && layer.visualization == @format.fetch_record!(:visualization)
raise Carto::UnauthorizedError.new
end
end
end
end
end
end