snaptable 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99241310030666c77c51744b07fa34293025bea
|
4
|
+
data.tar.gz: f796a2c56420af3425159a6c12d09e6bf8526605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf86f29ed27079a301a36c2a28c65d14fe3316d175b252dc02e216ae8e8b3b2df84796bad762b2bc22f59d5321cc3501ebf16c2d50ea2a4a65af53cc7bf7145
|
7
|
+
data.tar.gz: 3f8a32a4ba14ad93322de8e5922bfe696d722ac21e941568d5a1bf6208a0d7bf44a44d6f394c2f9ac3e7b02ee9319dcabefc97a86d91d52344ee18e466fed5af
|
@@ -3,11 +3,7 @@ module Snaptable
|
|
3
3
|
module Collection
|
4
4
|
|
5
5
|
def collection
|
6
|
-
|
7
|
-
current_permission.records(params[:controller], model, @token)
|
8
|
-
else
|
9
|
-
model
|
10
|
-
end.includes(belongs_to_associations)
|
6
|
+
model.includes(belongs_to_associations)
|
11
7
|
end
|
12
8
|
|
13
9
|
def records
|
@@ -4,26 +4,22 @@ module Snaptable
|
|
4
4
|
|
5
5
|
def add_button?
|
6
6
|
Snaptable.add_button &&
|
7
|
-
(!Snaptable.use_permission ||
|
8
|
-
current_permission.allow_create?(params[:controller]))
|
7
|
+
(!Snaptable.use_permission || rights?(:create, params[:controller]))
|
9
8
|
end
|
10
9
|
|
11
10
|
def edit_button?
|
12
11
|
Snaptable.edit_button &&
|
13
|
-
(!Snaptable.use_permission ||
|
14
|
-
current_permission.allow_modify?(params[:controller], "update"))
|
12
|
+
(!Snaptable.use_permission || rights?(:update, params[:controller]))
|
15
13
|
end
|
16
14
|
|
17
15
|
def show_button?
|
18
16
|
Snaptable.show_button &&
|
19
|
-
(!Snaptable.use_permission ||
|
20
|
-
current_permission.allow_modify?(params[:controller], "read"))
|
17
|
+
(!Snaptable.use_permission || rights?(:read, params[:controller]))
|
21
18
|
end
|
22
19
|
|
23
20
|
def delete_button?
|
24
21
|
Snaptable.delete_button &&
|
25
|
-
(!Snaptable.use_permission ||
|
26
|
-
current_permission.allow_modify?(params[:controller], "destroy"))
|
22
|
+
(!Snaptable.use_permission || rights?(:destroy, params[:controller]))
|
27
23
|
end
|
28
24
|
|
29
25
|
end
|
data/lib/snaptable/version.rb
CHANGED