- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
In order to create a system user using runmode (sling:OsgiConfig) with acs-commons, create a config as below.
- Create a sling:OsgiConfig under /apps/project-name/config/com.adobe.acs.commons.users.impl.EnsureServiceUser-customServiceUser.xml
- Add the below code in config file.
<?xml version="1.0" encoding="UTF-8"?><jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"jcr:primaryType="sling:OsgiConfig"principalName="project-system-user" //Add desired system user name heretype="add"ensure-immediately="{Boolean}true"aces="[type=allow;privileges=jcr:read\,jcr:modifyproperties;path=/content/we-retail]"/>
Once you deploy the code , you can see the system user created in your useradmin with the name you specified in the config file.
Note: You can make modifications as needed.
Hope this helps!!
Happy Coding 🙏
If you like my post and find it helpful, you can buy me a coffee.
- Get link
- X
- Other Apps
Comments
It will save time. Thanks 👍
ReplyDeleteThanks 😊
DeleteUseful information
ReplyDeleteThanks :)
Deletegreat information
ReplyDelete