Check for overall asset delete permissions before checking to see if the user can delete that specific asset

This commit is contained in:
snipe 2017-08-03 19:49:41 -07:00
parent 7adfab9d9f
commit 3e8b7d9c94

View file

@ -373,7 +373,10 @@ class AssetsController extends Controller
*/
public function destroy($id)
{
$this->authorize('delete', Asset::class);
if ($asset = Asset::find($id)) {
$this->authorize('delete', $asset);
DB::table('assets')