Skip to content

Commit

Permalink
fix: showLink attr does not respect show link setting
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Oct 3, 2023
1 parent 6df7d3d commit b2b35a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PermissionBasedForumSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(SettingsRepositoryInterface $settings)
public function __invoke(ForumSerializer $serializer, $model, array $attributes): array
{
// The link is visible if the user can access the user directory AND the link was enabled in extension settings
$attributes['canSeeUserDirectoryLink'] = $serializer->getActor()->can('seeUserList');
$attributes['canSeeUserDirectoryLink'] = $serializer->getActor()->can('seeUserList') && $this->settings->get('fof-user-directory-link');

// Only serialize if the actor has permission
if ($permission = $serializer->getActor()->hasPermission('user.suspend')) {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api/ForumAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function admin_does_not_have_user_directory_link_when_setting_disabled()
*/
public function admin_has_user_directory_link_when_setting_enabled()
{
$this->setting('fof-user-directory.admin.settings.link', true);
$this->setting('fof-user-directory-link', true);

$response = $this->send(
$this->request(
Expand Down

0 comments on commit b2b35a9

Please sign in to comment.