I'm working with a large list of abilities for users with different Role types on a rails application. This is with the CanCanCan gem.
It has gotten quite large, and I have non-dev users who want to be able to see a run-down of abilities for different users. How can I represent the existing abilities on a user interface?
class MyUserAbilityController < ActionController::Base
@abilities = current_user.abilities
@full_abilities = Hash.new
Role.all.each do |role|
@full_abilities[role.name] = role.abilities
I have decided to develop a gem to solve this answer, it's still very much in development, but soon fit for purpose. It's called CanCanCanSee.
It brings you the method
CanCanCanSee.all_abilities to render a hash of existing abilities and roles.
Also if you want to run a pretty printed version of your abilities from the Terminal (think like you do with
rake routes) you have