rbac_core 0.0.2 → 0.0.3

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: 16f2b1d7dc417b3b2f4ef7c28502cfdb7d85f66c
4
- data.tar.gz: ae73acfbfb80c8c238f2b7def7cfbb00fc848a4d
3
+ metadata.gz: 3052b5cce327658cc2c957432c456a5041a6394e
4
+ data.tar.gz: 1e7bd8c9b799b916c097018c244a7efc05b635b7
5
5
  SHA512:
6
- metadata.gz: 3c1e7f76583f6fe81aebce97f3361d0e00d24673a9702bfff79eb9400d9738f22b0f13bf880daf5d86508424d627b08d7665e30ece18a9780451733642bde9e1
7
- data.tar.gz: 92d7089fb749b5ea3307cfc97be4dc359e24da1a43388a622adebbd8dc6c7c1a2d834140e6d50904b2faf11418a7d345c7f4dbc0295306fbdeb9d27d29039dc8
6
+ metadata.gz: a2034552c254ba6cb7539d531004c7d42df0849f1229740c819fab4fc9b3b5f1a349abf4aa1db06d2629d9c6514d58a93b961d889a229ea167c8dab8445b6bdd
7
+ data.tar.gz: e2192ecc0b42239526d0c98b0c61fdf42781a80c2dc9a0bb18ce36e8f7cfe656ba9cdb1a9bd35eb9a299a70858c0619f4807e83446cfda2558dbc13a715d1280
data/lib/rbac_core.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "rbac_core/engine"
2
2
 
3
3
  require "options_model"
4
- require "rbac_core/permission_adapter"
4
+ require "rbac_core/permission"
5
5
  require "rbac_core/mapper"
6
6
  require "rbac_core/permission_set"
7
7
 
@@ -13,16 +13,16 @@ module RbacCore
13
13
  @permission_set_class ||= PermissionSet.derive "Global"
14
14
  end
15
15
 
16
- def permission_adapter_class
17
- @permission_adapter_class ||= PermissionAdapter
16
+ def permission_class
17
+ @permission_class ||= Permission
18
18
  end
19
19
 
20
- def permission_adapter_class=(klass)
21
- unless klass && klass < PermissionAdapter
22
- raise ArgumentError, "#{klass} should be sub-class of #{PermissionAdapter}."
20
+ def permission_class=(klass)
21
+ unless klass && klass < Permission
22
+ raise ArgumentError, "#{klass} should be sub-class of #{Permission}."
23
23
  end
24
24
 
25
- @permission_adapter_class = klass
25
+ @permission_class = klass
26
26
  end
27
27
  end
28
28
  end
@@ -1,5 +1,5 @@
1
1
  module RbacCore
2
- class PermissionAdapter
2
+ class Permission
3
3
  attr_reader :action, :priority
4
4
 
5
5
  def initialize(action, priority: 0, **options, &block)
@@ -16,7 +16,7 @@ module RbacCore
16
16
  end
17
17
 
18
18
  def ==(other)
19
- unless other.is_a?(RbacCore::PermissionAdapter)
19
+ unless other.is_a?(RbacCore::Permission)
20
20
  return false
21
21
  end
22
22
 
@@ -36,7 +36,7 @@ module RbacCore
36
36
  raise ArgumentError, "`name` can't be blank" if name.blank?
37
37
 
38
38
  attribute name, :boolean, default: default
39
- registered_permissions[name] = RbacCore.permission_adapter_class.new name, options, &block
39
+ registered_permissions[name] = RbacCore.permission_class.new name, options, &block
40
40
  end
41
41
  end
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module RbacCore
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbac_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jasl
@@ -55,7 +55,7 @@ files:
55
55
  - lib/rbac_core/concerns/models/role.rb
56
56
  - lib/rbac_core/engine.rb
57
57
  - lib/rbac_core/mapper.rb
58
- - lib/rbac_core/permission_adapter.rb
58
+ - lib/rbac_core/permission.rb
59
59
  - lib/rbac_core/permission_set.rb
60
60
  - lib/rbac_core/version.rb
61
61
  - lib/tasks/rbac_core_tasks.rake