diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart index 66747056..c69d1d10 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_files_list.dart @@ -188,6 +188,10 @@ class _BuildFilesListState extends State { } void viewFilePopUp(String fileName, String filePath, int fileID, String url) { + bool hasAccessToDelete = false; + if (widget.type == "business") { + hasAccessToDelete = true; + } showDialog( context: context, barrierDismissible: false, @@ -206,7 +210,7 @@ class _BuildFilesListState extends State { ], windowTools: [ Visibility( - visible: widget.type == "business", + visible: hasAccessToDelete, child: IconButton( onPressed: () { deleteFilePopUp(filePath, fileID); diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart index a31fc2d5..d79d37ef 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_notes_list.dart @@ -129,6 +129,11 @@ class _BuildNotesListState extends State { userNameController.text = selectednote.doctor; dateController.text = selectednote.insert_date; }); + bool hasAccessToDelete = false; + if (widget.type == "business" && + selectednote.doc_office == widget.business!.Name) { + hasAccessToDelete = true; + } showDialog( context: context, barrierDismissible: false, @@ -137,7 +142,7 @@ class _BuildNotesListState extends State { windowTitle: selectednote.note_name, windowTools: [ Visibility( - visible: widget.type == "business", + visible: hasAccessToDelete, child: IconButton( onPressed: () { deletePatientPopUp(selectednote.idpatient_notes);