Expand my Community achievements bar.

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

Avatar

Level 3

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

9 Replies

Avatar

Administrator

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-manage...

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

I hope this would help you.

~kautuk



Kautuk Sahni

Avatar

Community Advisor

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

Avatar

Administrator

nupurjain​ did you get the solution for this one?

~kautuk



Kautuk Sahni

Avatar

Level 9

HI,

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

Regards,

Jitendra

Avatar

Administrator

MC Stuff​ any help here?

~kautuk



Kautuk Sahni

Avatar

Level 3

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>

Avatar

Level 9

Hi Dipti,

While installing the package use merge option .

Thanks,

Avatar

Administrator

diptinarang nupurjain Check the comments from MC Stuff.

// While installing use merge option.

~kautuk



Kautuk Sahni