We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7f9342 commit 4dbbbc1Copy full SHA for 4dbbbc1
wiki/hooks.py
@@ -13,7 +13,7 @@
13
"logo": "/assets/wiki/images/wiki-logo.png",
14
"title": "Wiki",
15
"route": "/app/wiki",
16
- # "has_permission": "erpnext.check_app_permission",
+ "has_permission": "wiki.utils.check_app_permission",
17
}
18
]
19
wiki/utils.py
@@ -0,0 +1,14 @@
1
+import frappe
2
+
3
4
+def check_app_permission():
5
+ """Check if user has permission to access the app (for showing the app on app screen)"""
6
7
+ if frappe.session.user != "Administrator":
8
+ return True
9
10
+ roles = frappe.get_roles()
11
+ if "Wiki Approver" in roles:
12
+ return False
0 commit comments