icfnext / 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.
Other
159 stars 94 forks source link

Configuring multiple allowed user groups does not work #87

Closed stefanseifert closed 4 years ago

stefanseifert commented 4 years ago

if multiple groups are defined as "allowed groups" - example:

  com.icfolson.aem.groovy.console.configuration.impl.DefaultConfigurationService
    allowedGroups=["administrators","content-authors"]

script execution does not work but fails with an exception

java.lang.ClassCastException: class java.util.LinkedHashSet cannot be cast to class java.util.List (java.util.LinkedHashSet and java.util.List are in module java.base of loader 'bootstrap')
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.intersect(DefaultGroovyMethods.java:11536)
    at org.codehaus.groovy.runtime.dgm$349.doMethodInvoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.invoke(PojoMetaMethodSite.java:51)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
    at com.icfolson.aem.groovy.console.configuration.impl.DefaultConfigurationService.hasPermission(DefaultConfigurationService.groovy:53)
    at com.icfolson.aem.groovy.console.configuration.ConfigurationService$hasPermission.call(Unknown Source)
    at com.icfolson.aem.groovy.console.servlets.ScriptPostServlet.doPost(ScriptPostServlet.groovy:32)
...

it works if only one group is defined.

stefanseifert commented 4 years ago

this problem seems to go away with #88 (although not directly related) - perhaps only a local problem