From 7ce6b277726ff287781af79e9792fb2b70ad1c8a Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 18 Aug 2022 17:03:44 +0200 Subject: [PATCH] Protected Audit Log page behind labs flag refs https://github.com/TryGhost/Toolbox/issues/356 - even though I was hiding the button, it's better to prevent going to the route entirely by redirecting to the homepage if the labs flag is not enabled --- ghost/admin/app/routes/settings/audit-log.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ghost/admin/app/routes/settings/audit-log.js b/ghost/admin/app/routes/settings/audit-log.js index b676d7b823..838134d580 100644 --- a/ghost/admin/app/routes/settings/audit-log.js +++ b/ghost/admin/app/routes/settings/audit-log.js @@ -1,6 +1,16 @@ import AdminRoute from 'ghost-admin/routes/admin'; +import {inject as service} from '@ember/service'; export default class AuditLogRoute extends AdminRoute { + @service feature; + + beforeModel() { + super.beforeModel(...arguments); + if (!this.feature.auditLog) { + return this.transitionTo('home'); + } + } + buildRouteInfoMetadata() { return { titleToken: 'Settings - Audit log'