diff --git a/app/javascript/dashboard/helper/routeHelpers.js b/app/javascript/dashboard/helper/routeHelpers.js index 292e5e6e1..2f18132b5 100644 --- a/app/javascript/dashboard/helper/routeHelpers.js +++ b/app/javascript/dashboard/helper/routeHelpers.js @@ -67,8 +67,14 @@ export const validateLoggedInRoutes = (to, user) => { return validateActiveAccountRoutes(to, user); } - // If the current account is not active, then redirect the user to the suspended screen - if (to.name !== 'account_suspended') { + // If the current account is not active, only the suspended screen is + // reachable; administrators can also access billing to restore the account + const userPermissions = getUserPermissions(user, to.params.accountId); + const accessibleRoutes = userPermissions.includes('administrator') + ? ['account_suspended', 'billing_settings_index'] + : ['account_suspended']; + + if (!accessibleRoutes.includes(to.name)) { return `accounts/${to.params.accountId}/suspended`; } diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index 5852b5769..b133ca590 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -264,7 +264,8 @@ "EMAIL_VERIFICATION_SENT": "Verification email has been sent. Please check your inbox.", "ACCOUNT_SUSPENDED": { "TITLE": "Account Suspended", - "MESSAGE": "Your account has been suspended due to activity that may violate our policies. If you believe this is a mistake, please contact our support team." + "MESSAGE": "Your account has been suspended due to activity that may violate our policies. If you believe this is a mistake, please contact our support team.", + "MANAGE_BILLING": "Manage billing" }, "NO_ACCOUNTS": { "TITLE": "No account found", diff --git a/app/javascript/dashboard/routes/dashboard/suspended/Index.vue b/app/javascript/dashboard/routes/dashboard/suspended/Index.vue index 027f75ff5..bc7a2fa06 100644 --- a/app/javascript/dashboard/routes/dashboard/suspended/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/suspended/Index.vue @@ -1,7 +1,16 @@