Skip to content
Merged

4.2dev #3860

Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions phpmyfaq/src/phpMyFAQ/Permission/BasicPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,16 @@ public function refuseAllUserRights(int $userId): bool
{
return $this->repository->refuseAllUserRights($userId);
}

/**
* Returns an array with the IDs of all groups the user belongs to.
* Since this is BasicPermission, always return an empty array.
*
* @param int $userId User ID
* @return array<int>
*/
public function getUserGroups(int $userId): array
{
return [];
}
}
4 changes: 4 additions & 0 deletions phpmyfaq/src/phpMyFAQ/Twig/TwigWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use phpMyFAQ\System;
use phpMyFAQ\Twig\Extensions\PluginTwigExtension;
use phpMyFAQ\Twig\Extensions\TranslateTwigExtension;
use phpMyFAQ\Twig\Extensions\LanguageCodeTwigExtension;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
Expand Down Expand Up @@ -63,6 +64,9 @@ public function __construct(
// Always add the translation extension
$this->twigEnvironment->addExtension(new AttributeExtension(TranslateTwigExtension::class));

// Always add the LanguageCode Extension
$this->twigEnvironment->addExtension(new AttributeExtension(LanguageCodeTwigExtension::class));

// Add the plugin extension if it's not in the setup phase
if (!$this->isSetup) {
$this->twigEnvironment->addExtension(new AttributeExtension(PluginTwigExtension::class));
Expand Down
Loading