mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +00:00 
			
		
		
		
	organize imports
This commit is contained in:
		
							parent
							
								
									8cb72ac52c
								
							
						
					
					
						commit
						6ea17eea67
					
				@ -19,7 +19,7 @@ const {
 | 
			
		||||
  cloneDeep,
 | 
			
		||||
} = require('lodash/fp');
 | 
			
		||||
 | 
			
		||||
const { contentTypes, traverseEntity, traverse, sanitize, pipeAsync } = require('@strapi/utils');
 | 
			
		||||
const { contentTypes, traverseEntity, sanitize, pipeAsync, traverse } = require('@strapi/utils');
 | 
			
		||||
const { removePassword } = require('@strapi/utils').sanitize.visitors;
 | 
			
		||||
const { ADMIN_USER_ALLOWED_FIELDS } = require('../../../domain/user');
 | 
			
		||||
 | 
			
		||||
@ -45,7 +45,6 @@ const STATIC_FIELDS = [ID_ATTRIBUTE];
 | 
			
		||||
module.exports = ({ action, ability, model }) => {
 | 
			
		||||
  const schema = strapi.getModel(model);
 | 
			
		||||
 | 
			
		||||
  const { sanitizePasswords } = sanitize.sanitizers;
 | 
			
		||||
  const { allowedFields } = sanitize.visitors;
 | 
			
		||||
  const { traverseQueryFilters, traverseQuerySort, traverseQueryPopulate, traverseQueryFields } =
 | 
			
		||||
    traverse.traversals;
 | 
			
		||||
@ -131,7 +130,7 @@ module.exports = ({ action, ability, model }) => {
 | 
			
		||||
      // Remove not allowed fields (RBAC)
 | 
			
		||||
      traverseEntity(allowedFields(permittedFields), { schema }),
 | 
			
		||||
      // Remove all fields of type 'password'
 | 
			
		||||
      sanitizePasswords(schema)
 | 
			
		||||
      sanitize.sanitizers.sanitizePasswords(schema)
 | 
			
		||||
    );
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -17,9 +17,16 @@ const {
 | 
			
		||||
  isObject,
 | 
			
		||||
} = require('lodash/fp');
 | 
			
		||||
 | 
			
		||||
const { contentTypes, traverseEntity, traverse, validate, pipeAsync } = require('@strapi/utils');
 | 
			
		||||
const { throwPassword } = require('@strapi/utils').validate.visitors;
 | 
			
		||||
const { ValidationError } = require('@strapi/utils');
 | 
			
		||||
const {
 | 
			
		||||
  contentTypes,
 | 
			
		||||
  traverseEntity,
 | 
			
		||||
  traverse,
 | 
			
		||||
  validate,
 | 
			
		||||
  pipeAsync,
 | 
			
		||||
  ValidationError,
 | 
			
		||||
} = require('@strapi/utils');
 | 
			
		||||
 | 
			
		||||
const { throwPassword, throwDisallowedFields } = validate.visitors;
 | 
			
		||||
const { ADMIN_USER_ALLOWED_FIELDS } = require('../../../domain/user');
 | 
			
		||||
 | 
			
		||||
const { constants, isScalarAttribute, getNonVisibleAttributes, getWritableAttributes } =
 | 
			
		||||
@ -39,7 +46,6 @@ const STATIC_FIELDS = [ID_ATTRIBUTE];
 | 
			
		||||
module.exports = ({ action, ability, model }) => {
 | 
			
		||||
  const schema = strapi.getModel(model);
 | 
			
		||||
 | 
			
		||||
  const { throwDisallowedFields } = validate.visitors;
 | 
			
		||||
  const { traverseQueryFilters, traverseQuerySort, traverseQueryFields } = traverse.traversals;
 | 
			
		||||
 | 
			
		||||
  const createValidateQuery = (options = {}) => {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user