Hey Carsten, Thanks for the info, I will definitely follow up on the progress of what you are making then :).
One remark though, you say it's not the task of the bundle developer to create the user and assigning the rights. I can follow in this, but this also means that the potential users of the bundle you create has to know exactly the name of the service user and the rights required for the bundle to work. Is there going to be some sort of mechanism (like the require-capability header) to tell the users of the bundle what the needed user and rights are? Maybe even a webconsole plugin showing which bundles aren't satisfied Greetings, Roy > On 6 Nov 2016, at 09:51, Carsten Ziegeler <cziege...@apache.org> wrote: > > Roy Teeuwen wrote >> Hey all, >> >> Seeing as it is now best practice to not use the getAdminResourceResolver >> anymore but go for the getServiceResourceResolver, what is the best way to >> have a bundle on it's own create the service user that belongs to the >> bundle. I know you can put the >> org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-mybundle.xml >> in the SLING-INF folder, but this only creates the mapping of the service >> user for your bundle, not the actual user. I have seen some mails about the >> repo init interface, but if I understand this correctly then that interface >> is fired on startup and before the jcr repository is live as osgi service. >> What then when you want to install a bundle that creates a service user for >> itself after the instance is already live? >> > > I think the best way to do this is doing it outside of the bundle. > Creating a service user, assigning rights to the user and associating > this with a bundle is not the task of the bundle developer. > > The easiest way to create a service user including the required OSGi > configurations and ACLs is the provisioning model using the repoinit part. > > At the moment, this requires to add all this info to the launchpad > provisioning model you have and therefore is nothing you can do at > runtime. But I'm working on a tool which exactly allows this. So you can > put a provisioning model into an install folder and it will install > everything contained in that model including repoinit stuff. > > Carsten > > -- > Carsten Ziegeler > Adobe Research Switzerland > cziege...@apache.org >