It occurs to me that once I’ve taken a long time setting up security roles, as soon as the app is cloned or deployed, those roles are lost, as they’re database-driven. Is there any way to preserve these settings (to hide menu options, screens, and attributes for certain roles)? I would think that there’s got to be a way to do this, but I have no idea how to do this.
you can export roles in JSON/ZIP format just right in the Roles screen (look up for button in table).
To load this data automatically you can use standard import data service (see docs for details).
currently in version 7.1 there is the ability to use the JSON export from the entity inspector. In order to import you can use the admin-addon, which has the auto-import subsystem, which allows you to easily put the JSON in source code and execute it automatically at application start: GitHub - cuba-platform/admin-tools-addon: Interactive runtime diagnosis for CUBA applications