just_auth_me 0.0.2alpha → 0.0.3alpha
Sign up to get free protection for your applications and to get access to all the features.
@@ -40,9 +40,9 @@ module JustAuthMe
|
|
40
40
|
# Authorize resource
|
41
41
|
raise JustAuthMe::AnauthorizedAccess unless current_user
|
42
42
|
|
43
|
-
if (params[:action] != 'index'
|
44
|
-
params[:action] != 'create' and
|
45
|
-
params[:action] != 'new'
|
43
|
+
if ((params[:action] != 'index' or options[:through]) and
|
44
|
+
(params[:action] != 'create' or options[:through]) and
|
45
|
+
(params[:action] != 'new' or options[:through]) and
|
46
46
|
instance_variable_defined?(auth_object))
|
47
47
|
|
48
48
|
raise JustAuthMe::AnauthorizedAccess unless current_user.id == instance_variable_get(auth_object).user_id
|
data/lib/just_auth_me/version.rb
CHANGED