Skip to content

Commit

Permalink
Fixed #7250 - permission issue for API fieldsets and fields endpoints
Browse files Browse the repository at this point in the history
This applies the change from #7294 to master
  • Loading branch information
snipe committed Jul 24, 2019
1 parent a0f3fc6 commit 250a797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/CustomFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CustomFieldsController extends Controller

public function index()
{
$this->authorize('index', CustomFields::class);
$this->authorize('index', CustomField::class);
$fields = CustomField::get();
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
}
Expand All @@ -38,7 +38,7 @@ public function index()
*/
public function show($id)
{
$this->authorize('show', CustomField::class);
$this->authorize('view', CustomField::class);
if ($field = CustomField::find($id)) {
return (new CustomFieldsTransformer)->transformCustomField($field);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/CustomFieldsetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function index()
*/
public function show($id)
{
$this->authorize('show', CustomFieldset::class);
$this->authorize('view', CustomFieldset::class);
if ($fieldset = CustomFieldset::find($id)) {
return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset);
}
Expand Down

0 comments on commit 250a797

Please sign in to comment.