1
0
mirror of https://github.com/flarum/core.git synced 2025-07-21 16:51:34 +02:00
This commit is contained in:
Toby Zerner
2015-07-28 15:35:03 +09:30
parent 44767cb329
commit 864df225c2

View File

@@ -61,13 +61,9 @@ abstract class Model extends Eloquent
*/ */
public function can(User $actor, $action) public function can(User $actor, $action)
{ {
$can = static::$dispatcher->until(new ModelAllow($this, $actor, $action)); $allowed = static::$dispatcher->until(new ModelAllow($this, $actor, $action));
if ($can !== null) { return $allowed ?: false;
return $can;
}
return false;
} }
/** /**