]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Adding initial version of the OAuth token authentication method. This adds basic...
[rails.git] / app / controllers / trace_controller.rb
index 0248ad7cd4874d7c9cd294ccf4c73fe31fea6c1a..667f8577402cc822a2afe19b8947c9b49e57f87f 100644 (file)
@@ -9,6 +9,8 @@ class TraceController < ApplicationController
   before_filter :check_database_writable, :only => [:create, :edit, :delete, :make_public]
   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
@@ -18,6 +20,7 @@ class TraceController < ApplicationController
     if target_user.nil? and !display_name.blank?
       target_user = User.find(:first, :conditions => [ "visible = ? and display_name = ?", true, display_name])
       if target_user.nil?
+        @title = t'trace.no_such_user.title'
         @not_found_user = display_name
         render :action => 'no_such_user', :status => :not_found
         return