1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 08:56:38 +02:00

Make AbstractPolicy compatible with both object and class as $model (#1977)

This commit is contained in:
Clark Winkelmann
2020-04-19 15:52:59 +02:00
committed by GitHub
parent 798a3486bf
commit b5accca957
3 changed files with 77 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ abstract class AbstractPolicy
*/
public function getPermission(GetPermission $event)
{
if (! $event->model instanceof $this->model) {
if (! $event->model instanceof $this->model && $event->model !== $this->model) {
return;
}