diff --git a/app/Http/Controllers/Api/CustomFieldsController.php b/app/Http/Controllers/Api/CustomFieldsController.php index c425347c58..8feb2a1160 100644 --- a/app/Http/Controllers/Api/CustomFieldsController.php +++ b/app/Http/Controllers/Api/CustomFieldsController.php @@ -23,7 +23,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()); } @@ -37,7 +37,7 @@ class CustomFieldsController extends Controller */ public function show($id) { - $this->authorize('show', CustomField::class); + $this->authorize('view', CustomField::class); if ($field = CustomField::find($id)) { return (new CustomFieldsTransformer)->transformCustomField($field); } @@ -58,9 +58,9 @@ class CustomFieldsController extends Controller { $this->authorize('update', CustomField::class); $field = CustomField::findOrFail($id); - + /** - * Updated values for the field, + * Updated values for the field, * without the "field_encrypted" flag, preventing the change of encryption status * @var array */ diff --git a/app/Http/Controllers/Api/CustomFieldsetsController.php b/app/Http/Controllers/Api/CustomFieldsetsController.php index 08533229ee..321959b9fd 100644 --- a/app/Http/Controllers/Api/CustomFieldsetsController.php +++ b/app/Http/Controllers/Api/CustomFieldsetsController.php @@ -50,7 +50,7 @@ class CustomFieldsetsController extends Controller */ public function show($id) { - $this->authorize('show', CustomFieldset::class); + $this->authorize('view', CustomFieldset::class); if ($fieldset = CustomFieldset::find($id)) { return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset); }