Created
          December 9, 2013 10:47 
        
      - 
      
- 
        Save holyketzer/7870414 to your computer and use it in GitHub Desktop. 
    CanCan ability class
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class Ability | |
| include CanCan::Ability | |
| def initialize(user) | |
| # Define abilities for the passed in user here. | |
| user ||= User.new # guest user (not logged in) | |
| if user.admin? | |
| can :manage, :all | |
| end | |
| # See the wiki for details: | |
| # https://github.com/ryanb/cancan/wiki/Defining-Abilities | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment