How to include a user with permissions in a content package? | Community
Skip to main content
diptinarang
Level 3
November 8, 2016

How to include a user with permissions in a content package?

  • November 8, 2016
  • 6 replies
  • 9238 views

The use case is to include a custom user as part of a content package. The user abc ('/home/users/system/abc/‘) which is under a group ‘everyone’  has all permissions only on ‘/content/projects’ node. I don’t want to include '/content/projects/rep:policy’ as part of the package as there might be some other permissions already present on the ‘projects’ node. Is there any other way to include this user in the content package?

Thanks

Dipti

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

kautuk_sahni
Community Manager
Community Manager
November 8, 2016

Check ACL packager.

Link:- https://adobe-consulting-services.github.io/acs-aem-commons/features/acl-packager.html

// 

Purpose
Frequently, access control entries need to be copied from one environment to another without copying the actual content itself, just the access control entries. This user interface allows you to define and build packages containing access control entries for particular paths and/or particular principals.

Reference articles:-

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__ufln-i_packed_theusergr.html

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__0mo3-we_have_a_groupname.html

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__ajav-ive_searchedhighan.html

I hope this would help you.

~kautuk

Kautuk Sahni
Nupur_Jain
Adobe Employee
Adobe Employee
November 21, 2016

I tried it out , it does grab all the user permissions but I have a specific use case : If the user has permissions in /content i.e there is node "allow2" of jcr:primaryType "rep:GrantAce" , so using ACS ACL packager will build the /content/rep:policy node in the content package.

What if the new instance in which I want to install my package already has a "allow2" node under /content/rep:policy (containing permissions for some other user ), in this use case I would get an error "Error: org.apache.jackrabbit.vault.packaging.PackageException: javax.jcr.nodetype.ConstraintViolationException: Item is protected."
 while installing the package.

Is there any other way to grab permissions so that it does not collide with other permission when I install my package

kautuk_sahni
Community Manager
Community Manager
June 12, 2017

nupurjain​ did you get the solution for this one?

~kautuk

Kautuk Sahni
Jitendra_S_Toma
Level 10
November 8, 2016

HI,

@Kutuk pointed out. ACL tool to grab all the permissions of al the users. That is the recommended approach.

Regards,

Jitendra

kautuk_sahni
Community Manager
Community Manager
July 3, 2017

MC Stuff​ any help here?

~kautuk

Kautuk Sahni
MaxBarrass
Level 3
July 3, 2017

Try adding a user to you package and ensure you have .content.xml and _rep_policy.xml with

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
   jcr:primaryType="rep:ACL">
  <allow
   jcr:primaryType="rep:GrantACE"
   rep:principalName="everyone"
   rep:privileges="{Name}[jcr:all]"/>
</jcr:root>

MC_Stuff
Level 10
July 4, 2017

Hi Dipti,

While installing the package use merge option .

Thanks,

kautuk_sahni
Community Manager
Community Manager
July 4, 2017

diptinarang nupurjain Check the comments from MC Stuff.

// While installing use merge option.

~kautuk

Kautuk Sahni