File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44ruby  '3.2.2' 
55
66gem  'bootsnap' ,  require : false 
7+ gem  'cancancan' 
78gem  'graphql' ,  '~> 2.0.27'  # Locked due to https://github.com/github/graphql-client/issues/310 
89gem  'graphql-client' 
910gem  'http' 
Original file line number Diff line number Diff line change 102102    bootsnap  (1.17.0 )
103103      msgpack  (~>  1.2 )
104104    builder  (3.2.4 )
105+     cancancan  (3.5.0 )
105106    capybara  (3.39.2 )
106107      addressable 
107108      matrix 
@@ -367,6 +368,7 @@ DEPENDENCIES
367368  better_errors 
368369  binding_of_caller 
369370  bootsnap 
371+   cancancan 
370372  capybara 
371373  climate_control 
372374  debug 
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true 
2+ 
3+ class  Ability 
4+   include  CanCan ::Ability 
5+ 
6+   def  initialize ( user ) 
7+     # Define abilities for the user here. For example: 
8+     # 
9+     #   return unless user.present? 
10+     #   can :read, :all 
11+     #   return unless user.admin? 
12+     #   can :manage, :all 
13+     # 
14+     # The first argument to `can` is the action you are giving the user 
15+     # permission to do. 
16+     # If you pass :manage it will apply to every action. Other common actions 
17+     # here are :read, :create, :update and :destroy. 
18+     # 
19+     # The second argument is the resource the user can perform the action on. 
20+     # If you pass :all it will apply to every resource. Otherwise pass a Ruby 
21+     # class of the resource. 
22+     # 
23+     # The third argument is an optional hash of conditions to further filter the 
24+     # objects. 
25+     # For example, here the user can only update published articles. 
26+     # 
27+     #   can :update, Article, published: true 
28+     # 
29+     # See the wiki for details: 
30+     # https://github.com/CanCanCommunity/cancancan/blob/develop/docs/define_check_abilities.md 
31+   end 
32+ end 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments