di-simple_auth 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|