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 +1 -1
- data/lib/simple_auth/authentication.rb +3 -3
- metadata +2 -2
data/VERSION.yml
CHANGED
@@ -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
|