Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

System user and content deployment in AEM as a Cloud Service

Prince_Shivhare
Level 9
Level 9

Hello Everyone,

 

I am currently working on an AEM as a cloud service.

 

Where we have adobe cloud git repo. and limited access to higher environments.

 

now we have a requirement to create system users in AEM and also content deployment.

 

But we don't have access to crx/explorer and  CRX package manager.

 

Can anyone please help me to know about this in detail?

I read this article -  https://sling.apache.org/documentation/bundles/repository-initialization.html
but not able to understand anything.

 

Thank you

1 Accepted Solution
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @Prince_Shivhare 

 

To create the system user you can leverage the Repo Init service i.e. create an OSGi config under the deafult run mode with the below name:

org.apache.sling.jcr.repoinit.RepositoryInitializer-projectname.config and add the following content to it. You can customize as needed and once the code is deployed the system user will be created and required permission will be set.

 

scripts=[
"
create service user demo-user
set ACL on /content/project
allow jcr:read for demo-user
end
"
]

 

Now coming to Content Deployment which can be done in both Cloud Manager as well as Package Manager. Please see the link below for more details:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/deploying/over...

 

Hope this helps!

Thanks

View solution in original post

7 Replies
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @Prince_Shivhare 

 

To create the system user you can leverage the Repo Init service i.e. create an OSGi config under the deafult run mode with the below name:

org.apache.sling.jcr.repoinit.RepositoryInitializer-projectname.config and add the following content to it. You can customize as needed and once the code is deployed the system user will be created and required permission will be set.

 

scripts=[
"
create service user demo-user
set ACL on /content/project
allow jcr:read for demo-user
end
"
]

 

Now coming to Content Deployment which can be done in both Cloud Manager as well as Package Manager. Please see the link below for more details:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/deploying/over...

 

Hope this helps!

Thanks

View solution in original post

Prince_Shivhare
Level 9
Level 9
But I need a write access as well because we will save the file /etc/customnode node as well.
Prince_Shivhare
Level 9
Level 9

I created in this way -- XML file

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
jcr:primaryType="sling:OsgiConfig"
scripts="[ create service user systemuser
set ACL on /etc/productfeed
allow jcr:read , rep:write for systemuser
end ]"/>
asutosh_jena
Community Advisor
Community Advisor

Hi @Prince_Shivhare 

 

Please see the below screenshot:

asutosh_jena_0-1619668058456.png

 

replace aem65app with your project name.

 

Thanks!

jbrar
Employee
Employee

You need to create a cfg.json OSGI config for repo init to create system users and assign permissions. See docs below:

 

 

[1] https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/developing/aem...