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: 4a19a2c1a6d4b3ff9d7feb2f2b00b16340d270de
4
- data.tar.gz: e62032e3e29745cff520cb909069813e31825c1f
3
+ metadata.gz: e99241310030666c77c51744b07fa34293025bea
4
+ data.tar.gz: f796a2c56420af3425159a6c12d09e6bf8526605
5
5
  SHA512:
6
- metadata.gz: deb203f35cd3da48b6690faf700a076f77f7c79be8a37d2df3b19d59f4a5468cfb713a313b37531ea2149acf289d25e4c8c17761529e15aafa114076afe14dc7
7
- data.tar.gz: 6435a0d6a8771bf1ca201ccf6ce93ba1ff95214a31dcc3387452850ea69b0541ffbad2efe5c01e5c8b291a4075b146ec0719fbb2ef8ed8fae623cfc15119fbc0
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
- @collection ||= if Snaptable.use_permission
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
@@ -1,3 +1,3 @@
1
1
  module Snaptable
2
- VERSION = "0.9.3"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - khcr