Add "permission denied" message on modal forms

This commit is contained in:
Oliver Walters 2020-10-01 00:09:21 +10:00
parent 81864a6ab8
commit 56660d52f2

View File

@ -807,7 +807,19 @@ function launchModalForm(url, options = {}) {
}
},
error: function (xhr, ajaxOptions, thrownError) {
$(modal).modal('hide');
// Permission denied!
if (xhr.status == 403) {
showAlertDialog(
"Permission Denied",
"You do not have the required permissions to access this function"
);
return;
}
showAlertDialog('Error requesting form data', renderErrorMessage(xhr));
}
};