lib/simple_auth/authentication.rb in di-simple_auth-0.2.6 vs lib/simple_auth/authentication.rb in di-simple_auth-0.2.7
- old
+ new
@@ -102,13 +102,13 @@
::User.find_by_remember_token(token)
end
end
def permission_from_token(invoice)
- if current_user
- current_user.permissions(invoice).max_by{|v| v.index }
- elsif _token = params[:token][10..-1]
+ if _token = params[:token][10..-1]
::Permission.find_by_token(_token)
+ elsif current_user
+ current_user.permissions(invoice).max_by{|v| v.index }
end
end
def store_location
if request.get?
\ No newline at end of file