Skip to content

Commit

Permalink
Fix for policies (#860)
Browse files Browse the repository at this point in the history
Policies cannot be used now due to this reason. And additionally, the method `Auth::user()` returns the class `Authenticatable` (which is used in gates), not `Authorizable`.

Also, I believe the class `Authenticatable` should be used since it is checking its instance on the line 33.
  • Loading branch information
ShawnCZek authored and barryvdh committed Aug 22, 2018
1 parent 59d310c commit 5b68f39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/DataCollector/GateCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Barryvdh\Debugbar\DataFormatter\SimpleFormatter;
use DebugBar\DataCollector\MessagesCollector;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable;
use Symfony\Component\VarDumper\Cloner\VarCloner;

Expand All @@ -24,7 +23,7 @@ public function __construct(Gate $gate)
$gate->after([$this, 'addCheck']);
}

public function addCheck(Authorizable $user = null, $ability, $result, $arguments = [])
public function addCheck(Authenticatable $user = null, $ability, $result, $arguments = [])
{
$userKey = 'user';
$userId = null;
Expand Down

0 comments on commit 5b68f39

Please sign in to comment.