Skip to content
kristianmandrup edited this page Apr 15, 2012 · 1 revision

Debugging permits and abilities

CanTango has the following class methods to make it easy to debug Permits from within anywhere in your app.

puts CanTango.permits_allowed
puts CanTango.permits_denied
puts CanTango.debug_permits_registry

puts CanTango.debug_ability current_user, :edit, Project.first

Debug configuration

Debug Registration: Which permits have been registered and for which types?

CanTango.config.permits do |permits|
  puts permits.registry_for :account_type # Registry for :account_type permits
  puts permits.registered_for :account_type # names of AccountType permits
  puts permits.all

  puts permits.show_all
end

Clone this wiki locally