di-simple_auth 0.2.6 → 0.2.7
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
@@ -104,10 +104,10 @@ module SimpleAuth
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def permission_from_token(invoice)
|
107
|
-
if
|
108
|
-
current_user.permissions(invoice).max_by{|v| v.index }
|
109
|
-
elsif _token = params[:token][10..-1]
|
107
|
+
if _token = params[:token][10..-1]
|
110
108
|
::Permission.find_by_token(_token)
|
109
|
+
elsif current_user
|
110
|
+
current_user.permissions(invoice).max_by{|v| v.index }
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|