mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 11:54:10 +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;
 | 
						|
    }
 | 
						|
  },
 | 
						|
});
 |