Module: CanTango::Ability::RoleHelpers

Includes:
Helpers::RoleMethods
Included in:
CanTango::Ability, PermissionEngine, PermitEngine, UserAcEngine
Defined in:
lib/cantango/ability/role_helpers.rb

Instance Method Summary collapse

Methods included from Helpers::RoleMethods

#config, #has_role_group_meth, #has_role_meth, #role_groups_list_meth, #roles_list_meth

Instance Method Details

#role_groupsObject

return list of symbols for role groups the user belongs to



14
15
16
17
# File 'lib/cantango/ability/role_helpers.rb', line 14

def role_groups
  return [] if !subject.respond_to?(role_groups_list_meth) || role_groups_of(subject).blank?
  role_groups_of(subject).flatten
end

#rolesObject

return list roles the user has



8
9
10
11
# File 'lib/cantango/ability/role_helpers.rb', line 8

def roles
  return [] if !subject.respond_to?(roles_list_meth) || roles_of(subject).blank?
  roles_of(subject).flatten
end