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

Reply via email to