class Ability include CanCan::Ability def initialize(user, user_role) case (user_role) when 1: # administrator can :manage, :all when 2: # presbyter can :read, :all when 3: # secretary can :read, :all when 4: # area_pastor can :read, :all when 5: # coordinator can :read, :all when 6: # supervisor can :read, :all when 7: # leader can :read, :all when 8: # member can :read, :all when 9: # frequenter can :read, :all else # guest user, what TODO ?? end end end
<% if can? :update, ConfigMaster, current_user_role %> ... <% end %>
|Is there a "ruby on rails" distro of linux ?||3||584|
|Choosing a Server-Side Scripting Language - Criterion 1||12||461|
|Ruby error when trying to install mysql2 ruby gem||3||905|
|Ruby script to take single regular expression and search directory||1||550|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!