Module: CanTango::PermitEngine::RoleMatcher

Included in:
CanTango::Permits::Permit
Defined in:
lib/cantango/permit_engine/role_matcher.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


8
9
10
# File 'lib/cantango/permit_engine/role_matcher.rb', line 8

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

#role_match?(user_account) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/cantango/permit_engine/role_matcher.rb', line 4

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