Skip to content

Commit

Permalink
Merge pull request #42993 from shariquerik/apps-page-fix
Browse files Browse the repository at this point in the history
fix: added app permission check for apps page
  • Loading branch information
shariquerik authored Aug 30, 2024
2 parents b01ac4d + 1d9ed27 commit 9d4ad98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions erpnext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import inspect

import frappe
from frappe.utils.user import is_website_user

__version__ = "16.0.0-dev"

Expand Down Expand Up @@ -149,3 +150,13 @@ def caller(*args, **kwargs):
return frappe.get_attr(overrides[function_path][-1])(*args, **kwargs)

return caller


def check_app_permission():
if frappe.session.user == "Administrator":
return True

if is_website_user():
return False

return True
2 changes: 1 addition & 1 deletion erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"logo": "/assets/erpnext/images/erpnext-logo-blue.png",
"title": "ERPNext",
"route": "/app/home",
# "has_permission": "erpnext.api.permission.has_app_permission"
"has_permission": "erpnext.check_app_permission",
}
]

Expand Down

0 comments on commit 9d4ad98

Please sign in to comment.