di-simple_auth 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 3
3
- :patch: 3
3
+ :patch: 4
4
4
  :major: 0
@@ -26,8 +26,8 @@ module SimpleAuth
26
26
  end
27
27
 
28
28
 
29
- def current_permission(invoice)
30
- @_current_permission ||= permission_from_token(invoice)
29
+ def current_permission(invoice = nil)
30
+ @_current_permission ||= permission_from_token(invoice)
31
31
  end
32
32
 
33
33
 
@@ -124,7 +124,7 @@ module SimpleAuth
124
124
  def permission_from_token(invoice)
125
125
  if params[:token] && _token = params[:token][12..-1]
126
126
  ::Permission.find_by_token(_token)
127
- elsif current_user
127
+ elsif current_user && invoice
128
128
  current_user.permissions(invoice).max_by{|v| v.index }
129
129
  end
130
130
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 3
9
- version: 0.3.3
8
+ - 4
9
+ version: 0.3.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dieinzige