mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +00:00 
			
		
		
		
	accept permissions params for api-tokens
This commit is contained in:
		
							parent
							
								
									f208e0c69d
								
							
						
					
					
						commit
						8cc144679d
					
				@ -24,6 +24,7 @@ module.exports = {
 | 
			
		||||
      name: trim(body.name),
 | 
			
		||||
      description: trim(body.description),
 | 
			
		||||
      type: body.type,
 | 
			
		||||
      permissions: body.permissions,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    await validateApiTokenCreationInput(attributes);
 | 
			
		||||
 | 
			
		||||
@ -15,6 +15,10 @@ const apiTokenCreationSchema = yup
 | 
			
		||||
      .string()
 | 
			
		||||
      .oneOf(Object.values(constants.API_TOKEN_TYPE))
 | 
			
		||||
      .required(),
 | 
			
		||||
    permissions: yup
 | 
			
		||||
      .array()
 | 
			
		||||
      .of(yup.string())
 | 
			
		||||
      .nullable(),
 | 
			
		||||
  })
 | 
			
		||||
  .noUnknown();
 | 
			
		||||
 | 
			
		||||
@ -30,6 +34,10 @@ const apiTokenUpdateSchema = yup
 | 
			
		||||
      .string()
 | 
			
		||||
      .oneOf(Object.values(constants.API_TOKEN_TYPE))
 | 
			
		||||
      .notNull(),
 | 
			
		||||
    permissions: yup
 | 
			
		||||
      .array()
 | 
			
		||||
      .of(yup.string())
 | 
			
		||||
      .nullable(),
 | 
			
		||||
  })
 | 
			
		||||
  .noUnknown();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user