Module: RbacCore

Defined in:
lib/rbac_core.rb,
lib/rbac_core/engine.rb,
lib/rbac_core/mapper.rb,
lib/rbac_core/version.rb,
lib/rbac_core/permission.rb,
app/models/rbac_core/role.rb,
lib/rbac_core/permission_set.rb,
lib/rbac_core/computed_permissions.rb,
app/models/rbac_core/application_record.rb

Defined Under Namespace

Modules: Concerns Classes: ApplicationRecord, ComputedPermissions, Engine, Mapper, Permission, PermissionSet, Role

Constant Summary collapse

VERSION =
"0.0.11"

Class Method Summary collapse

Class Method Details

.permission_classObject



27
28
29
# File 'lib/rbac_core.rb', line 27

def permission_class
  @permission_class ||= Permission
end

.permission_class=(klass) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/rbac_core.rb', line 31

def permission_class=(klass)
  unless klass && klass < Permission
    raise ArgumentError, "#{klass} should be sub-class of #{Permission}."
  end

  @permission_class = klass
end

.permission_set_classObject



15
16
17
# File 'lib/rbac_core.rb', line 15

def permission_set_class
  @permission_set_class ||= PermissionSet.derive "Global"
end

.permission_set_class=(klass) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/rbac_core.rb', line 19

def permission_set_class=(klass)
  unless klass && klass < PermissionSet
    raise ArgumentError, "#{klass} should be sub-class of #{PermissionSet}."
  end

  @permission_set_class = klass
end