]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Implement automatic OAuth setup for Potlatch 2
[rails.git] / app / models / user.rb
index ecf93b6f790f5505d78ccaab1905e7e5827dec17..1db8adab7fcea045f4b1a05516859a57aa579043 100644 (file)
@@ -203,4 +203,10 @@ class User < ActiveRecord::Base
 
     return score.to_i
   end
+
+  ##
+  # return an oauth access token for a specified application
+  def access_token(application_key)
+    return ClientApplication.find_by_key(application_key).access_token_for_user(self)
+  end
 end