strapi/packages/core/admin/server/policies/isTelemetryEnabled.js

17 lines
413 B
JavaScript

'use strict';
const { createPolicy } = require('@strapi/utils').policy;
/**
* This policy is used for routes dealing with telemetry and analytics content.
* It will fails when the telemetry has been disabled on the server.
*/
module.exports = createPolicy({
name: 'admin::isTelemetryEnabled',
handler(_ctx, _config, { strapi }) {
if (strapi.telemetry.isDisabled) {
return false;
}
},
});