feat: app switcher

This commit is contained in:
Jannat Patel
2024-08-23 12:21:22 +05:30
parent e02e4c7ab4
commit ec25e895dc
5 changed files with 94 additions and 10 deletions

View File

@@ -597,3 +597,15 @@ def get_members(start=0, search=""):
member.role = "LMS Student"
return members
def check_app_permission():
"""Check if the user has permission to access the app."""
if frappe.session.user == "Administrator":
return True
roles = frappe.get_roles()
lms_roles = ["Moderator", "Course Creator", "Batch Evaluator", "LMS Student"]
if any(role in roles for role in lms_roles):
return True
return False