diff --git a/app/Http/Controllers/Api/CustomFieldsController.php b/app/Http/Controllers/Api/CustomFieldsController.php index cd93a46383ce..4a7f24f53c7e 100644 --- a/app/Http/Controllers/Api/CustomFieldsController.php +++ b/app/Http/Controllers/Api/CustomFieldsController.php @@ -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()); } @@ -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); } diff --git a/app/Http/Controllers/Api/CustomFieldsetsController.php b/app/Http/Controllers/Api/CustomFieldsetsController.php index f5cfafdf930c..ab070810396d 100644 --- a/app/Http/Controllers/Api/CustomFieldsetsController.php +++ b/app/Http/Controllers/Api/CustomFieldsetsController.php @@ -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); }