mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			400 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			400 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| const { yup, formatYupErrors } = require('strapi-utils');
 | |
| 
 | |
| const hasPermissionsSchema = yup.array().of(yup.string());
 | |
| 
 | |
| const validateHasPermissionsInput = actions => {
 | |
|   try {
 | |
|     return hasPermissionsSchema.validateSync(actions, { strict: true, abortEarly: true });
 | |
|   } catch (e) {
 | |
|     throw new Error(formatYupErrors(e));
 | |
|   }
 | |
| };
 | |
| 
 | |
| module.exports = {
 | |
|   validateHasPermissionsInput,
 | |
| };
 | 
