1
0
mirror of https://github.com/flarum/core.git synced 2025-07-24 18:21:33 +02:00

Fix regression in permission logic: make sure admins can do everything

This commit is contained in:
Toby Zerner
2015-11-04 09:23:02 +10:30
parent d6e6e517a1
commit 8bda570e7c

View File

@@ -69,7 +69,7 @@ class CoreServiceProvider extends AbstractServiceProvider
});
$this->app->make('flarum.gate')->before(function (User $actor, $ability, $model = null) {
if (! $model && $actor->hasPermission($ability)) {
if ($actor->isAdmin() || (! $model && $actor->hasPermission($ability))) {
return true;
}