mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix(server): premissions guard for read and write endpoints
This commit is contained in:
@@ -57,7 +57,7 @@ function GlobalErrors({
|
||||
if (globalErrors.access_denied) {
|
||||
toastKeySomethingWrong = AppToaster.show(
|
||||
{
|
||||
message: intl.get('global_error.you_dont_have_permissions'),
|
||||
message: globalErrors.access_denied.message || intl.get('global_error.you_dont_have_permissions'),
|
||||
intent: Intent.DANGER,
|
||||
onDismiss: () => {
|
||||
globalErrorsSet({ access_denied: false });
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function useApiRequest() {
|
||||
setLogout();
|
||||
}
|
||||
if (status === 403) {
|
||||
setGlobalErrors({ access_denied: true });
|
||||
setGlobalErrors({ access_denied: { message: data.message } });
|
||||
}
|
||||
if (status === 429) {
|
||||
setGlobalErrors({ too_many_requests: true });
|
||||
|
||||
Reference in New Issue
Block a user