diff --git a/draw/api/permission.py b/draw/api/permission.py index 6fe4367..3674075 100644 --- a/draw/api/permission.py +++ b/draw/api/permission.py @@ -8,6 +8,12 @@ import frappe +def has_app_permission(user: str | None = None) -> bool: + """Whether to show Frappe Draw on the Desk /apps launcher — any signed-in + (non-Guest) user.""" + return (user or frappe.session.user) != "Guest" + + def query_conditions(user: str | None = None) -> str: """SQL clause limiting Draw Diagram list queries to what `user` may see: their own diagrams, ones shared with them, and public ones. System Managers diff --git a/draw/hooks.py b/draw/hooks.py index a1c6a58..548a7f8 100644 --- a/draw/hooks.py +++ b/draw/hooks.py @@ -15,16 +15,16 @@ # required_apps = [] -# Each item in the list will be shown as an app in the apps page -# add_to_apps_screen = [ -# { -# "name": "draw", -# "logo": "/assets/draw/logo.png", -# "title": "Frappe Draw", -# "route": "/draw", -# "has_permission": "draw.api.permission.has_app_permission" -# } -# ] +# Show Frappe Draw in the Desk /apps launcher (violet 3-node logomark). +add_to_apps_screen = [ + { + "name": "draw", + "logo": "/assets/draw/logo.svg", + "title": "Frappe Draw", + "route": "/draw", + "has_permission": "draw.api.permission.has_app_permission", + } +] # Includes in
# ------------------ diff --git a/draw/public/logo.svg b/draw/public/logo.svg new file mode 100644 index 0000000..b2947ab --- /dev/null +++ b/draw/public/logo.svg @@ -0,0 +1,7 @@ +