Module: CanTango::PermitEngine::Util

Included in:
Ability, CanTango::Permits::Permit
Defined in:
lib/cantango/permit_engine/util.rb

Instance Method Summary collapse

Instance Method Details

#localhost_manager?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/cantango/permit_engine/util.rb', line 15

def localhost_manager?
  Permits::Configuration.localhost_manager
end

#permit_name(clazz) ⇒ Object



6
7
8
# File 'lib/cantango/permit_engine/util.rb', line 6

def permit_name clazz
  @name ||= clazz.to_s.demodulize.gsub(/Role/,'').gsub(/Permit$/, '').gsub(/Group/,'').underscore.to_sym
end

#roleObject

TODO:



11
12
13
# File 'lib/cantango/permit_engine/util.rb', line 11

def role
  @role ||= permit_name
end