can_can_dry 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 8616fc62b40c6d68a3a18f5b62a07584031f0512f344806e6b5b131b1858b512
4
- data.tar.gz: ad1b3dabb44835740a3249728ca53fa63050512c5554e8fbd127f57ef035ea80
3
+ metadata.gz: 27b5f57ba600a70ecebc6b97f31416bf65f2e77140b9d7782a38f20e94f36a52
4
+ data.tar.gz: 2268863133f1485f707fc9636d2e5415a5acac46cba7fb53027905ae6742d4ae
5
5
  SHA512:
6
- metadata.gz: a441d9615f99a9b6abec4678df0b4d58252a34c4f600da1ceb2136b1509e3515a01a744fdd2c2f31ee84cec7824bba9489f85f581fa11e31e2495ccc67fc3e32
7
- data.tar.gz: bd08893454b207ebf90fbc0d76981571b2651008e309b7ef7156082b015829d59144e47df50b31b3c53dbefa8b93c1d03b0349acac3a510d09ae5cf3ea9c6629
6
+ metadata.gz: 9d4e4832c2be237136b371d127a25d5167fd2db514b394d901f31e4761795a987f792c5ba5ba6c8af956bccf5cd4b2bdff2438bddd41b76dacf9bbdb2e93ba29
7
+ data.tar.gz: 6e0f2009afda013043e980b650b007e128a9bc8e856a3dcec13ea73253f0ceaeda748d200d38679878c704c7565471e6150563ebeb199d1918212df461e74d89
@@ -4,6 +4,7 @@ require 'cancancan'
4
4
  module CanCanDry
5
5
  require 'can_can_dry/railtie'
6
6
  require_dependency 'can_can_dry/controller_authorization'
7
+ require_dependency 'can_can_dry/ability_mapping_sets/active_scaffold'
7
8
  require_dependency 'can_can_dry/ability_mapping_sets/devise'
8
9
  require_dependency 'can_can_dry/ability_mapping_sets/devise_invitable'
9
10
  require_dependency 'can_can_dry/ability_mapping'
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+ module CanCanDry
3
+ module AbilityMappingSets
4
+ module ActiveScaffold
5
+ ACTIVE_SCAFFOLD_MAPPING = {
6
+ read: [:browse, :index, :mark, :render_field, :show, :show_search],
7
+ create: [:create, :new],
8
+ update: [:add_existing, :edit, :edit_associated, :new_existing, :update, :update_column],
9
+ destroy: [:destroy, :destroy_existing]
10
+ }.freeze
11
+
12
+ def map_active_scaffold(controller, entity)
13
+ ACTIVE_SCAFFOLD_MAPPING.each do |can_action, actions|
14
+ actions.each { |action| map_action controller, action.to_s, can_action, entity }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module CanCanDry
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: can_can_dry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-28 00:00:00.000000000 Z
11
+ date: 2019-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -63,6 +63,7 @@ files:
63
63
  - lib/can_can_dry/ability_mapping.rb
64
64
  - lib/can_can_dry/ability_mapping/action_mapping_not_found.rb
65
65
  - lib/can_can_dry/ability_mapping/path_mapping_not_found.rb
66
+ - lib/can_can_dry/ability_mapping_sets/active_scaffold.rb
66
67
  - lib/can_can_dry/ability_mapping_sets/devise.rb
67
68
  - lib/can_can_dry/ability_mapping_sets/devise_invitable.rb
68
69
  - lib/can_can_dry/controller_authorization.rb