mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "permission denied" message on modal forms
This commit is contained in:
parent
81864a6ab8
commit
56660d52f2
@ -807,7 +807,19 @@ function launchModalForm(url, options = {}) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function (xhr, ajaxOptions, thrownError) {
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
|
||||||
$(modal).modal('hide');
|
$(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));
|
showAlertDialog('Error requesting form data', renderErrorMessage(xhr));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user