Skip to content

Commit 8b7089e

Browse files
committed
fix: restrict app in apps page if no access to FCRM module
1 parent 2ccc637 commit 8b7089e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: crm/api/__init__.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import frappe
22
from bs4 import BeautifulSoup
3+
from frappe.config import get_modules_from_all_apps_for_user
34
from frappe.core.api.file import get_max_file_size
45
from frappe.translate import get_all_translations
56
from frappe.utils import cstr, split_emails, validate_email_address
@@ -63,10 +64,10 @@ def check_app_permission():
6364
if frappe.session.user == "Administrator":
6465
return True
6566

66-
# allowed_modules = frappe.utils.modules.get_modules_from_all_apps_for_user()
67-
# allowed_modules = [x["module_name"] for x in allowed_modules]
68-
# if "FCRM" not in allowed_modules:
69-
# return False
67+
allowed_modules = get_modules_from_all_apps_for_user()
68+
allowed_modules = [x["module_name"] for x in allowed_modules]
69+
if "FCRM" not in allowed_modules:
70+
return False
7071

7172
roles = frappe.get_roles()
7273
if any(

0 commit comments

Comments
 (0)