Skip to content

Commit

Permalink
Fix UserPolicy not being global and therefore being ignored (#106)
Browse files Browse the repository at this point in the history
* Fix `UserPolicy` not being global and therefore being ignored

* remove unused import
  • Loading branch information
iPurpl3x committed Sep 28, 2023
1 parent 6dedd08 commit 5bc2169
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Extend;
use Flarum\User\User;

return [
(new Extend\Frontend('admin'))
Expand All @@ -30,7 +29,7 @@
->attributes(PermissionBasedForumSettings::class),

(new Extend\Policy())
->modelPolicy(User::class, Access\UserPolicy::class),
->globalPolicy(Access\UserPolicy::class),

(new Extend\View())
->namespace('fof.user-directory', __DIR__.'/resources/views'),
Expand Down
2 changes: 1 addition & 1 deletion src/Access/UserPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class UserPolicy extends AbstractPolicy
{
public function seeUserList(User $actor, User $user)
public function seeUserList(User $actor)
{
return $actor->hasPermission('fof.user-directory.view') && $actor->hasPermission('searchUsers');
}
Expand Down

0 comments on commit 5bc2169

Please sign in to comment.