[Bug] TypeError: "fields is not iterable" in plugin-acl when creating/updating fields

Description:

When creating a new field (specifically a “Many to One” association in my case) or updating field associations, the application crashes with a TypeError: fields is not iterable. This appears to happen within the @nocobase/plugin-acl plugin when it tries to automatically update permissions for existing roles.

Environment:

• NocoBase Version: 2.0.0-beta.1-full
• Database: PostgreSQL 16
• Deployment: Docker

Steps to Reproduce:

• Have a NocoBase instance with existing roles/permissions configured.
• Attempt to add a new “Many to One” relationship field between two collections (e.g., account_brand → account).
• The request fails with a 500 error.

Root Cause Analysis:

The issue is located in node_modules/@nocobase/plugin-acl/dist/server/server.js within the fields.afterCreate listener.

The code fetches resourceActions and attempts to spread the fields property into a new array. However, if the retrieved fields value is null or undefined (which seems possible for certain ACL configurations), the spread operator fails.

Hello, I am unable to reproduce the problem you described.
please provide a reproduction of the issue in the demo environment.

https://a_8hwne7u84ho.v13.demo.nocobase.com/admin/
(NocoBase default username and password)