Skip to content
Merged
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
6 changes: 6 additions & 0 deletions draw/api/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions draw/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <head>
# ------------------
Expand Down
7 changes: 7 additions & 0 deletions draw/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading