ist-dresden / composum-nodes

Set of Apache Sling / AEM development tools: JCR browser, user and package management and more
https://www.composum.com/home/nodes.html
MIT License
55 stars 21 forks source link

Bugfix/310 #313

Closed royteeuwen closed 1 year ago

royteeuwen commented 1 year ago

solves #310: Authorizable interface is not a ConsumerType and so should not be implemented. See OAK-10252

royteeuwen commented 1 year ago

@stoerr could you have a look at this :)?

stoerr commented 1 year ago

@royteeuwen Thank you very much for your quite extensive work! Unfortunately I had some troube when testing it locally. When I try to add a user to a group or a group to a super group I get an exception, which I don't get with the old version.

19.09.2023 09:45:14.652 ERROR [0:0:0:0:0:0:0:1 [1695109514651] POST /bin/cpm/usermanagement.addtogroup.json HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable java.lang.ClassCastException: class org.apache.jackrabbit.oak.jcr.delegate.UserDelegator cannot be cast to class org.apache.jackrabbit.api.security.user.Group (org.apache.jackrabbit.oak.jcr.delegate.UserDelegator is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader@6e6f43f7; org.apache.jackrabbit.api.security.user.Group is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader@4199813a) at com.composum.sling.core.usermanagement.core.UserManagementServlet$AddToGroup.doIt(UserManagementServlet.java:256) [com.composum.nodes.usermgr :4.2.2.SNAPSHOT] at com.composum.sling.core.servlet.ServletOperationSet.doPost(ServletOperationSet.java:164)

Does adding a user to a group work for you? Sorry, I'm currently heads down in creating a release for the Adobe AEM variant of the Composum AI , so I have some trouble to seriously focus on this at the moment. :-)

stoerr commented 1 year ago

Ah: strangely, that happens only when I deploy it on a Sling 11 Starter (not the original version, but some intermediate state just before the feature launcher migration was done), but it does work on an AEM SDK. I didn't try other versions yet. So that'll probably need some more investigation on my side, if you don't have a wild guess what could be the reason.

Just checking: the same exception happens when Composum Nodes is deployed in a Sling Starter 12.

royteeuwen commented 1 year ago

No problem, I’ll fix it ;) only checked in aem sdk indeed.

royteeuwen commented 1 year ago

@stoerr i tested this and I can only reproduce this if you would try to add a user to a group by using the "Group" tab instead of the "Users" tab. See recording.

https://github.com/ist-dresden/composum-nodes/assets/4967758/39f27b77-14bb-4750-90af-3751bdbab977

Could it be that you were testing it wrongly?

stoerr commented 1 year ago

Oops, sorry, you're right, I triggered a preexisting bug without noticing. I guess the search in (super-)groups tab of a group should only show groups, not users. I created https://github.com/ist-dresden/composum-nodes/issues/314 for that. So this is not a problem with your PR; I'll merge it. Thank you for your contribution!