Skip to content
Snippets Groups Projects
Commit a70347aa authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '22-add-validator-for-faq' into 'master'

Resolve "Add validator for FAQ"

Closes #22

See merge request !37
parents 8e8ab10d 617fb777
No related branches found
No related tags found
1 merge request!37Resolve "Add validator for FAQ"
Pipeline #2913 passed
......@@ -7,6 +7,12 @@ MENUS = {
"url": "#",
"icon": "help_circle",
"root": True,
"validators": [
(
"aleksis.core.util.predicates.permission_validator",
"hjelp.show_menu",
),
],
"submenu": [
{
"name": _("Report an issue"),
......
......@@ -6,6 +6,18 @@ from aleksis.core.util.predicates import (
is_site_preference_set,
)
# Show Hjelp menu
show_hjelp_menu = is_site_preference_set("hjelp", "public_faq") | (
has_person &
(
has_global_perm("hjelp.view_faq") |
has_global_perm("hjelp.ask_faq") |
has_global_perm("hjelp.report_issue") |
has_global_perm("hjelp.send_feedback")
)
)
add_perm("hjelp.show_menu", show_hjelp_menu)
# View FAQ
view_faq_predicate = is_site_preference_set("hjelp", "public_faq") | (
has_person & has_global_perm("hjelp.view_faq")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment