orbinson / aem-groovy-console

The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the CQ, Sling, or JCR APIs.
https://orbinson.github.io/aem-groovy-console/
Other
16 stars 3 forks source link

Ship with an OSGi configuration by default which allows IMS AEM Administrator Product Profile users to use the Groovy Console #55

Open kwin opened 2 weeks ago

kwin commented 2 weeks ago

As by default only the admin user has the rights to execute the scripts in the Groovy Console (https://github.com/orbinson/aem-groovy-console?tab=readme-ov-file#osgi-configuration) but the admin user is not usable in AEMaaCS, the default configuration should also grant access to the administrators group or the according IMS Administrator Profile Name (accessible via environment variable $[env:aemCloudAdministrators;default=administrators]).

Please add an according OSGi configuration to https://github.com/orbinson/aem-groovy-console/tree/main/ui.config/src/main/content/jcr_root/apps/groovyconsole-config/osgiconfig/config. As the interpolation feature is available on Cloud only this requires a dedicated package for cloud.

kwin commented 2 weeks ago

I attached an example OSGi configuration which should achieve this (for AEMaaCS): be.orbinson.aem.groovy.console.configuration.impl.DefaultConfigurationService.cfg.json

kwin commented 2 weeks ago

FTR: You can see the same environment variable is being used internally by AEM for its org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl configuration PID (exposed via Developer Console -> Status Dump -> Configurations)