Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions education/api/permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import frappe


def has_app_permission():
"""Check if the user has permission to access the app."""
if frappe.session.user == "Administrator":
return True

roles = frappe.get_roles()
helpdesk_roles = ["Education Manager"]
if any(role in roles for role in helpdesk_roles):
return True

return False
10 changes: 10 additions & 0 deletions education/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@

required_apps = ["erpnext"]

add_to_apps_screen = [
{
"name": "education",
"logo": "/assets/education/edu-logo.svg",
"title": "Education",
"route": "/app/education",
"has_permission": "education.api.permissions.has_app_permission",
}
]

# Includes in <head>
# ------------------

Expand Down
10 changes: 10 additions & 0 deletions education/public/edu-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.