chore: remove deprecated check_admin_or_system_manager function (#19540)

This commit is contained in:
Ritwik Puri 2023-01-09 18:32:09 +05:30 committed by GitHub
parent f5771baf66
commit fabe3906aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,22 +27,6 @@ rights = (
)
def check_admin_or_system_manager(user=None):
from frappe.utils.commands import warn
warn(
"The function check_admin_or_system_manager will be deprecated in version 15."
'Please use frappe.only_for("System Manager") instead.',
category=PendingDeprecationWarning,
)
if not user:
user = frappe.session.user
if ("System Manager" not in frappe.get_roles(user)) and (user != "Administrator"):
frappe.throw(_("Not permitted"), frappe.PermissionError)
def print_has_permission_check_logs(func):
def inner(*args, **kwargs):
frappe.flags["has_permission_check_logs"] = []