Class: CanTango::Filter::RoleGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/cantango/roles_ext/filter/role_group.rb

Instance Method Summary collapse

Constructor Details

#initialize(role_group, role_groups = nil) ⇒ RoleGroup

Returns a new instance of RoleGroup.



6
7
8
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 6

def initialize role_group, role_groups = nil
  super      
end

Instance Method Details

#excluded?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 14

def excluded?
  !excluded_role_groups.empty? && excluded_role_groups.include?(role_group)
end

#excluded_role_groupsObject



22
23
24
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 22

def excluded_role_groups
  CanTango.config.role_groups.excluded
end

#not_only?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 10

def not_only?
  !only_role_groups.empty? && !only_role_groups.include?(role_group)
end

#only_role_groupsObject



18
19
20
# File 'lib/cantango/roles_ext/filter/role_group.rb', line 18

def only_role_groups
  CanTango.config.role_groups.onlies
end