Skip to content

Commit e9b59c2

Browse files
feat: show on apps screen
1 parent 8fcf54d commit e9b59c2

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

linklite/hooks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
# required_apps = []
2929

3030
# Each item in the list will be shown as an app in the apps page
31-
# add_to_apps_screen = [
32-
# {
33-
# "name": "linklite",
34-
# "logo": "/assets/linklite/logo.png",
35-
# "title": "LinkLite",
36-
# "route": "/linklite",
37-
# "has_permission": "linklite.api.permission.has_app_permission"
38-
# }
39-
# ]
31+
add_to_apps_screen = [
32+
{
33+
"name": "linklite",
34+
"logo": "/assets/linklite/logo.png",
35+
"title": "Link Lite",
36+
"route": "/frontend",
37+
"has_permission": "linklite.linklite.utils.permissions.has_app_permission"
38+
}
39+
]
4040

4141
# Includes in <head>
4242
# ------------------
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import frappe
2+
3+
def has_app_permission():
4+
"""Check if the user has permission to access the app."""
5+
if frappe.session.user == "Administrator":
6+
return True
7+
8+
roles = frappe.get_roles()
9+
if "Link Manager" in roles:
10+
return True
11+
12+
return False

linklite/public/logo.png

44.8 KB
Loading

0 commit comments

Comments
 (0)