File tree 3 files changed +35
-0
lines changed
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" }
4
4
ruby '3.2.2'
5
5
6
6
gem 'bootsnap' , require : false
7
+ gem 'cancancan'
7
8
gem 'graphql'
8
9
gem 'graphql-client'
9
10
gem 'http'
Original file line number Diff line number Diff line change 103
103
bootsnap (1.18.3 )
104
104
msgpack (~> 1.2 )
105
105
builder (3.2.4 )
106
+ cancancan (3.5.0 )
106
107
capybara (3.40.0 )
107
108
addressable
108
109
matrix
@@ -385,6 +386,7 @@ DEPENDENCIES
385
386
better_errors
386
387
binding_of_caller
387
388
bootsnap
389
+ cancancan
388
390
capybara
389
391
climate_control
390
392
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