fix: restrict app in apps page if no access to FCRM module
This commit is contained in:
parent
8f1b6f6b67
commit
fb9b026ad6
@ -3,6 +3,7 @@ from bs4 import BeautifulSoup
|
|||||||
from frappe.core.api.file import get_max_file_size
|
from frappe.core.api.file import get_max_file_size
|
||||||
from frappe.translate import get_all_translations
|
from frappe.translate import get_all_translations
|
||||||
from frappe.utils import cstr, split_emails, validate_email_address
|
from frappe.utils import cstr, split_emails, validate_email_address
|
||||||
|
from frappe.utils.modules import get_modules_from_all_apps_for_user
|
||||||
from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD
|
from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD
|
||||||
|
|
||||||
|
|
||||||
@ -63,10 +64,10 @@ def check_app_permission():
|
|||||||
if frappe.session.user == "Administrator":
|
if frappe.session.user == "Administrator":
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# allowed_modules = frappe.utils.modules.get_modules_from_all_apps_for_user()
|
allowed_modules = get_modules_from_all_apps_for_user()
|
||||||
# allowed_modules = [x["module_name"] for x in allowed_modules]
|
allowed_modules = [x["module_name"] for x in allowed_modules]
|
||||||
# if "FCRM" not in allowed_modules:
|
if "FCRM" not in allowed_modules:
|
||||||
# return False
|
return False
|
||||||
|
|
||||||
roles = frappe.get_roles()
|
roles = frappe.get_roles()
|
||||||
if any(
|
if any(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user