mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 02:44:13 +00:00
17 lines
413 B
JavaScript
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;
|
|
}
|
|
},
|
|
});
|