fix(acl): skip when field does not exist
This commit is contained in:
		
							parent
							
								
									b9ba44f36e
								
							
						
					
					
						commit
						d72480ac58
					
				@ -44,6 +44,12 @@ export class RoleResourceActionModel extends Model {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    for (const field of fields) {
 | 
					    for (const field of fields) {
 | 
				
			||||||
      const collectionField = collection.getField(field);
 | 
					      const collectionField = collection.getField(field);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (!collectionField) {
 | 
				
			||||||
 | 
					        console.log(`${field} does not exist`);
 | 
				
			||||||
 | 
					        continue;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const fieldType = collectionField.get('interface') as string;
 | 
					      const fieldType = collectionField.get('interface') as string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const fieldActions: AssociationFieldAction = associationFieldsActions?.[fieldType]?.[availableAction];
 | 
					      const fieldActions: AssociationFieldAction = associationFieldsActions?.[fieldType]?.[availableAction];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user