]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Fixed merge fail - this branch doesn't have javascript_strings.
[rails.git] / app / controllers / trace_controller.rb
index 9bddf9154d7c36d70da1a8c4f301f503a9197dfa..f06a162fbc00b850d03b971cc7a59ae9ad60ec62 100644 (file)
@@ -9,6 +9,8 @@ class TraceController < ApplicationController
   before_filter :check_database_writable, :only => [:create, :edit, :delete]
   before_filter :check_api_readable, :only => [:api_details, :api_data]
   before_filter :check_api_writable, :only => [:api_create]
+  before_filter :require_allow_read_gpx, :only => [:api_details, :api_data]
+  before_filter :require_allow_write_gpx, :only => [:api_create]
  
   # Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
   #  target_user - if set, specifies the user to fetch traces for.  if not set will fetch all traces
@@ -51,7 +53,7 @@ class TraceController < ApplicationController
       if @user and @user == target_user
         conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name)
       else
-        conditions = ["gpx_files.visibility <> 'private' AND gpx_files.user_id = ?", target_user.id] #4
+        conditions = ["gpx_files.public <> 'private' AND gpx_files.user_id = ?", target_user.id] #4
       end
     end