Fixed #7250 - permission issue for API fieldsets and fields endpoints

This applies the change from #7294 to master
This commit is contained in:
snipe 2019-07-24 11:00:42 -07:00
parent a0f3fc6d76
commit 250a797339
2 changed files with 3 additions and 3 deletions

View file

@ -24,7 +24,7 @@ class CustomFieldsController extends Controller
public function index() public function index()
{ {
$this->authorize('index', CustomFields::class); $this->authorize('index', CustomField::class);
$fields = CustomField::get(); $fields = CustomField::get();
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count()); return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
} }
@ -38,7 +38,7 @@ class CustomFieldsController extends Controller
*/ */
public function show($id) public function show($id)
{ {
$this->authorize('show', CustomField::class); $this->authorize('view', CustomField::class);
if ($field = CustomField::find($id)) { if ($field = CustomField::find($id)) {
return (new CustomFieldsTransformer)->transformCustomField($field); return (new CustomFieldsTransformer)->transformCustomField($field);
} }

View file

@ -58,7 +58,7 @@ class CustomFieldsetsController extends Controller
*/ */
public function show($id) public function show($id)
{ {
$this->authorize('show', CustomFieldset::class); $this->authorize('view', CustomFieldset::class);
if ($fieldset = CustomFieldset::find($id)) { if ($fieldset = CustomFieldset::find($id)) {
return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset); return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset);
} }