You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/6.x/extend/http.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,8 +138,8 @@ if (! Gate::check('activity-viewReports')) {
138
138
Gate::authorize('view', $report);
139
139
```
140
140
141
-
Unless another package has defined a simple gate, bare ability checks (like the first example) fall through to Craft permissions.
142
-
In the second example, we’re authorize against a specific object.
141
+
Unless another package has defined a simple gate with the exact name, bare ability checks (like the first example) fall through to Craft permissions.
142
+
In the second example, we’re authorizing against a specific object.
143
143
We do this internally, for elements: many related permissions determine whether a user can `save` an entry, so it doesn’t make sense to check against each of those specific permissions in each place an element might be saved.
144
144
Instead, these complex or compound checks are bundled with a [policy](laravel:authorization#creating-policies):
145
145
@@ -180,7 +180,7 @@ class ReportPolicy
180
180
}
181
181
```
182
182
183
-
[Register your policy class](authorization#manually-registering-policies) with Laravel’s gate system, specifying the resource it should be evaluated against:
183
+
[Register your policy class](laravel:authorization#manually-registering-policies) with Laravel’s gate system, specifying the resource it should be evaluated against:
184
184
185
185
```php
186
186
Gate::policy(Report::class, ReportPolicy::class);
@@ -202,7 +202,7 @@ Gate::before('saveEntries:a6dbf63e-89fb-4f17-9205-2e7469f0aa2a', function (User
202
202
In a plugin, the UUID in this example would need to be looked up, dynamically.
203
203
:::
204
204
205
-
In some situations, you may still need to resolve permissions directly via the user element:
205
+
In some situations, you may still need to resolve permissions directly via a user element:
0 commit comments