]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Allow abilities that require no login for token based access
[rails.git] / app / controllers / application_controller.rb
index 6c6a087b7d1b9dadd75a775ff8a688ad05da966f..d4bbc1f9b7147ada16f015a77f73a0fb56168aac 100644 (file)
@@ -446,9 +446,9 @@ class ApplicationController < ActionController::Base
   end
 
   def current_ability
-    # Add in capabilities from the oauth token if it exists and is a valid access token
+    # Use capabilities from the oauth token if it exists and is a valid access token
     if Authenticator.new(self, [:token]).allow?
-      Ability.new(current_user).merge(Capability.new(current_token))
+      Ability.new(nil).merge(Capability.new(current_token))
     else
       Ability.new(current_user)
     end