Skip to content

Commit 96a3f83

Browse files
author
Robert Mosolgo
authored
Merge pull request #1822 from ultramiraculous/patch-1
Fix typos in CanCan guide
2 parents 9be3139 + 5f68ae3 commit 96a3f83

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

guides/authorization/can_can_integration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For each object type, you can assign a required action for Ruby objects of that
5656
# app/graphql/types/base_object.rb
5757
class Types::BaseObject < GraphQL::Schema::Object
5858
# Add the CanCan integration:
59-
include GraphQL::Pro::CanCan::ObjectIntegration
59+
include GraphQL::Pro::CanCanIntegration::ObjectIntegration
6060
# By default, require `can :read, ...`
6161
can_can_action(:read)
6262
# Or, to require no permissions by default:
@@ -140,14 +140,14 @@ module Types::BaseInterface
140140
end
141141
```
142142

143-
Then, you can add `can_can_ability:` options to your fields:
143+
Then, you can add `can_can_action:` options to your fields:
144144

145145
```ruby
146146
class Types::JobPosting < Types::BaseObject
147147
# Only allow `can :review_applications, JobPosting` users
148148
# to see who has applied
149149
field :applicants, [Types::User], null: true,
150-
can_can_ability: :review_applicants
150+
can_can_action: :review_applicants
151151
end
152152
```
153153

@@ -161,7 +161,7 @@ Similar to field-level checks, you can require certain permissions to _use_ cert
161161
class Types::BaseArgument < GraphQL::Schema::Argument
162162
# Include the integration and default to no permissions required
163163
include GraphQL::Pro::CanCanIntegration::ArgumentIntegration
164-
can_can_ability nil
164+
can_can_action nil
165165
end
166166
```
167167

@@ -178,13 +178,13 @@ class Types::BaseInputObject < GraphQL::Schema::InputObject
178178
end
179179
```
180180

181-
Now, arguments accept a `can_can_ability:` option, for example:
181+
Now, arguments accept a `can_can_action:` option, for example:
182182

183183
```ruby
184184
class Types::Company < Types::BaseObject
185185
field :employees, Types::Employee.connection_type, null: true do
186186
# Only admins can filter employees by email:
187-
argument :email, String, required: false, can_can_ability: :admin
187+
argument :email, String, required: false, can_can_action: :admin
188188
end
189189
end
190190
```

0 commit comments

Comments
 (0)