Fixed API gate names in tranformers for new, more granular admin stuff

This commit is contained in:
snipe 2017-03-03 17:56:05 -08:00
parent 097096aa24
commit 6a2fd74219
3 changed files with 6 additions and 6 deletions

View file

@ -34,8 +34,8 @@ class CategoriesTransformer
];
$permissions_array['available_actions'] = [
'update' => Gate::allows('admin') ? true : false,
'delete' => Gate::allows('admin') ? true : false,
'update' => Gate::allows('update', Category::class) ? true : false,
'delete' => Gate::allows('delete', Category::class) ? true : false,
];
$array += $permissions_array;

View file

@ -39,8 +39,8 @@ class LocationsTransformer
];
$permissions_array['available_actions'] = [
'update' => Gate::allows('admin') ? true : false,
'delete' => Gate::allows('admin') ? true : false,
'update' => Gate::allows('update', Location::class) ? true : false,
'delete' => Gate::allows('delete', Location::class) ? true : false,
];
$array += $permissions_array;

View file

@ -32,8 +32,8 @@ class StatuslabelsTransformer
];
$permissions_array['available_actions'] = [
'edit' => Gate::allows('admin') ? true : false,
'delete' => Gate::allows('admin') ? true : false,
'update' => Gate::allows('update', Statuslabel::class) ? true : false,
'delete' => Gate::allows('delete', Statuslabel::class) ? true : false,
];
$array += $permissions_array;