Module: Cul::Omniauth::Users::ConfiguredRoles

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/cul/omniauth/users/configured_roles.rb

Instance Method Summary collapse

Instance Method Details

#role?(role_sym) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
# File 'app/models/concerns/cul/omniauth/users/configured_roles.rb', line 3

def role? role_sym
  super || begin
    found = false
    found = role_members(role_sym).detect {|member| self.role?(member.to_sym)}
  end
end

#role_members(role_sym) ⇒ Object



9
10
11
# File 'app/models/concerns/cul/omniauth/users/configured_roles.rb', line 9

def role_members(role_sym)
  Ability.config.fetch(role_sym.to_sym,{}).fetch(:members,[])
end