Class: CanTango::Permit::Role

Inherits:
Base
  • Object
show all
Extended by:
Helpers::RoleMethods, ClassMethods
Includes:
Helpers::RoleMethods, Helper::RoleMatcher
Defined in:
lib/cantango/roles_ext/permit/role.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helper::RoleMatcher

#role_group_match?, #role_match?

Constructor Details

#initialize(ability) ⇒ Role

creates the permit

Parameters:

  • the (Permits::Ability)

    ability

  • the (Hash)

    options



9
10
11
# File 'lib/cantango/roles_ext/permit/role.rb', line 9

def initialize ability
  super
end

Class Method Details

.hash_keyObject



17
18
19
# File 'lib/cantango/roles_ext/permit/role.rb', line 17

def self.hash_key
  roles_list_meth
end

Instance Method Details

#valid_for?(subject) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cantango/roles_ext/permit/role.rb', line 13

def valid_for? subject
  in_role? subject
end