Dear All
I need your help in appointment booking. Here is the scenario user 1 booked an appointment to a patient , next day the patient wants to reschedule user 2 tried to reschedule but system gave the following ( Not allowed via controller permission check ) , how can resolve this issue please
Thank you
Hi @Tamer_Zaki ,
Can you please share the error log in console and also can you show what are the user permissions and roles added for that users?
Thank you.
Thank you for your reply , kindly find role permission
Error ( Not permitted
Not allowed via controller permission check
User **.temo@mail.com
** does not have access to this document
Insufficient Permission for Event (write)
Console error
File “apps/frappe/frappe/model/document.py”, line 1249, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 912, in fn
return method_object(*args, **kwargs)
File “apps/healthcare/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py”, line 47, in validate
self.update_event()
File “apps/healthcare/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py”, line 351, in update_event
event_doc.save()
File “apps/frappe/frappe/model/document.py”, line 305, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 330, in _save
self.check_permission(“write”, “save”)
File “apps/frappe/frappe/model/document.py”, line 194, in check_permission
self.raise_no_permission_to(permtype)
File “apps/frappe/frappe/model/document.py”, line 216, in raise_no_permission_to
raise frappe.PermissionError
frappe.exceptions.PermissionError
request.js:457:14
Will need to check this, could you please let us know the app versions?
thanks!
Problem is in Event permission, look at code, is the Event is private only the creator has the permission…
def has_permission(doc, user):
if doc.event_type == "Public" or doc.owner == user:
return True
return False
Possible fix is in patient_appointment.py and force save event
event_doc.save(ignore_permissions=True)