I want to delete a button from the ribbon based on a custom state. I'm already using conditions to enable/disable buttons until the user configures the add-in, but I'm trying to create a "viewer-only" ribbon that doesn't even include buttons for creation/editing. The <updateModule>...<deleteButton> workflow is great, but I only need it to run for a viewer-only build.
My original idea was to check for a compiler directive in the add-in constructor and set a custom "viewer" state, which would then activate the <updateModule> section. Is this possible?