Module: CanTango::Permit::Helper::RoleMatcher

Included in:
Role, RoleGroup
Defined in:
lib/cantango/roles_ext/permit/helper/role_matcher.rb

Instance Method Summary collapse

Instance Method Details

#role_group_match?(candidate, group_name = nil) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/cantango/roles_ext/permit/helper/role_matcher.rb', line 8

def role_group_match? candidate, group_name = nil
  candidate.is_in_group? permit_name(self.class)
end

#role_match?(candidate) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/cantango/roles_ext/permit/helper/role_matcher.rb', line 4

def role_match? candidate
  candidate.has_role? permit_name(self.class)
end