From 3a02edb15f8ff644f6549ed25721da6d3ec7af29 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com> Date: Thu, 24 Sep 2020 11:30:27 -0400 Subject: [PATCH] Revert https://github.com/flarum/core/pull/1536 (#2305) --- framework/core/src/User/UserPolicy.php | 2 +- framework/core/tests/integration/api/users/UpdateTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/core/src/User/UserPolicy.php b/framework/core/src/User/UserPolicy.php index d9b26f9b0..4ccf128da 100644 --- a/framework/core/src/User/UserPolicy.php +++ b/framework/core/src/User/UserPolicy.php @@ -36,7 +36,7 @@ class UserPolicy extends AbstractPolicy */ public function find(User $actor, Builder $query) { - if ($actor->cannot('viewUserList')) { + if ($actor->cannot('viewDiscussions')) { if ($actor->isGuest()) { $query->whereRaw('FALSE'); } else { diff --git a/framework/core/tests/integration/api/users/UpdateTest.php b/framework/core/tests/integration/api/users/UpdateTest.php index f07229757..e143e6565 100644 --- a/framework/core/tests/integration/api/users/UpdateTest.php +++ b/framework/core/tests/integration/api/users/UpdateTest.php @@ -35,6 +35,7 @@ class UpdateTest extends TestCase ], 'group_permission' => [ ['permission' => 'viewUserList', 'group_id' => 3], + ['permission' => 'viewDiscussions', 'group_id' => 3] ] ]); }