Skip to content

Commit 8ae7fe2

Browse files
committed
fix(wizard): show FAQ items only if have right
see Html::displayMainMenu Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent b196808 commit 8ae7fe2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

inc/form.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,9 @@ public function showFormList(int $rootCategory = 0, string $keywords = '', bool
977977
}
978978
}
979979

980-
if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) != PluginFormcreatorEntityconfig::CONFIG_KB_DISTINCT) {
980+
if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) != PluginFormcreatorEntityconfig::CONFIG_KB_DISTINCT
981+
&& Session::haveRight('knowbase', KnowbaseItem::READFAQ)
982+
) {
981983
// Find FAQ entries
982984
$query_faqs = KnowbaseItem::getListRequest([
983985
'faq' => '1',

inc/wizard.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public static function header($title) {
107107
echo '<span class="label">'.__('My requests for assistance', 'formcreator').'</span>';
108108
echo '</a></li>';
109109

110-
if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) == PluginFormcreatorEntityConfig::CONFIG_KB_DISTINCT) {
110+
if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) == PluginFormcreatorEntityConfig::CONFIG_KB_DISTINCT
111+
&& Session::haveRight('knowbase', KnowbaseItem::READFAQ)
112+
) {
111113
echo '<li class="' . ($activeMenuItem == self::MENU_FAQ ? 'plugin_formcreator_selectedMenuItem' : '') . '">';
112114
echo '<a href="' . FORMCREATOR_ROOTDOC.'/front/knowbaseitem.php' . '">';
113115
echo '<span class="fc_list_icon fas fa-question" title="'.__('Knowledge Base', 'formcreator').'"></span>';

0 commit comments

Comments
 (0)