mdarby-restful_acl 2.0.5 → 2.0.6
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/lib/restful_acl_helper.rb +3 -7
- metadata +1 -1
data/lib/restful_acl_helper.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
1
|
module RestfulAclHelper
|
2
2
|
def indexable
|
3
3
|
return true if admin_enabled
|
4
|
-
|
5
|
-
parent = parent_obj rescue nil
|
6
|
-
klass.is_indexable_by(current_user, parent)
|
4
|
+
klass.is_indexable_by(current_user, parent_obj)
|
7
5
|
end
|
8
6
|
|
9
7
|
def creatable
|
10
8
|
return true if admin_enabled
|
11
|
-
|
12
|
-
parent = parent_obj rescue nil
|
13
|
-
klass.is_creatable_by(current_user, parent)
|
9
|
+
klass.is_creatable_by(current_user, parent_obj)
|
14
10
|
end
|
15
11
|
alias_method :createable, :creatable
|
16
12
|
|
@@ -48,7 +44,7 @@ module RestfulAclHelper
|
|
48
44
|
end
|
49
45
|
|
50
46
|
def parent_obj
|
51
|
-
parent_klass.find(parent_id)
|
47
|
+
parent_klass.find(parent_id) rescue nil
|
52
48
|
end
|
53
49
|
|
54
50
|
def parent_klass
|