Sidane
Active member
- Affected version
- 2.x
On the Notable Members page, when viewing a list of members, the sidebar "Members" list shows all links regardless of permission limits.
To Reproduce
Looking at
Also, this change would make line #111 redundant:
To Reproduce
- Create a new Member Statistics in the Admin CP, the search criteria aren't important
- Add a "Permission limit" which excludes guest users (e.g. Post new thread)
- Save the new Statistic
- View the Notable Members page as a guest user and click on any link in the sidebar (e.g. Most messages)
- A link to the newly created Member Statistics will be visible in the sidebar when it should not be
Looking at
XF\Pub\Controller\Member
I believe the issue is around line #48.
PHP:
$memberStats = $memberStatRepo
->findMemberStatsForDisplay()
->fetch();
$memberStats
is not being filtered based on user permissions, so it should be something like:
PHP:
$memberStats = $memberStatRepo
->findMemberStatsForDisplay()
->fetch()
->filterViewable();
Also, this change would make line #111 redundant:
PHP:
$memberStats = $memberStats->filterViewable();