Skip to content

Commit

Permalink
fix(wizard): show FAQ items only if have right
Browse files Browse the repository at this point in the history
see Html::displayMainMenu

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 23, 2021
1 parent b7be525 commit 8d2cdf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,9 @@ public function showFormList(int $rootCategory = 0, string $keywords = '', bool
}
}

if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) != PluginFormcreatorEntityconfig::CONFIG_KB_DISTINCT) {
if (PluginFormcreatorEntityConfig::getUsedConfig('is_kb_separated', Session::getActiveEntity()) != PluginFormcreatorEntityconfig::CONFIG_KB_DISTINCT
&& Session::haveRight('knowbase', KnowbaseItem::READFAQ)
) {
// Find FAQ entries
$query_faqs = KnowbaseItem::getListRequest([
'faq' => '1',
Expand Down
4 changes: 3 additions & 1 deletion inc/wizard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public static function header($title) {
echo '<span class="label">'.__('My requests for assistance', 'formcreator').'</span>';
echo '</a></li>';

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

0 comments on commit 8d2cdf1

Please sign in to comment.