Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.
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 %>
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!