Skip to content

Commit fb9b026

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

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
@@ -3,6 +3,7 @@
33
from frappe.core.api.file import get_max_file_size
44
from frappe.translate import get_all_translations
55
from frappe.utils import cstr, split_emails, validate_email_address
6+
from frappe.utils.modules import get_modules_from_all_apps_for_user
67
from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD
78

89

@@ -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)