]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/ability.rb
Update capabilities check to actually reflect the existing logic
[rails.git] / app / models / ability.rb
index 6a61eeff30b75e16690133fddfad0de51e364866..8fc15ded5b5e006d242d994b39255b3e079de615 100644 (file)
@@ -49,7 +49,9 @@ class Ability
     # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
   end
 
     # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
   end
 
+  # If a user provides no tokens, they've authenticated via a non-oauth method
+  # and permission to access to all capabilities is assumed.
   def has_capability?(token, cap)
   def has_capability?(token, cap)
-    token && token.read_attribute(cap)
+    token.nil? || token.read_attribute(cap)
   end
 end
   end
 end