forked from yaso_meth/mih-project
Doctor to only be able to delete their notes.
This commit is contained in:
@@ -188,6 +188,10 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
}
|
||||
|
||||
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<BuildFilesList> {
|
||||
],
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: widget.type == "business",
|
||||
visible: hasAccessToDelete,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deleteFilePopUp(filePath, fileID);
|
||||
|
||||
@@ -129,6 +129,11 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
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<BuildNotesList> {
|
||||
windowTitle: selectednote.note_name,
|
||||
windowTools: [
|
||||
Visibility(
|
||||
visible: widget.type == "business",
|
||||
visible: hasAccessToDelete,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
deletePatientPopUp(selectednote.idpatient_notes);
|
||||
|
||||
Reference in New Issue
Block a user