Codebay Innovation
CodeBay Featured (Slider) Security

How to grant permissions to subtree in Adobe AEM

Adobe AEM privileges

Basically an administrator takes advantage of Adobe AEM user manager tool to grant all privileges and arrange main security policies, but there are some scenario that requires an advanced configuration and it should be figure it out in a different way.
For example, to grant permissions only to view and edit pages under a specific subpage tree of the repository. Apparently it could be an easy task, but it would eventually reveals hard to arrange.

Let’s try to schematically represent the repository structure to face:

→ content

→ projectA

→ en

→ SubHome1

→ Subhome2

→ Article1

→ Article2

→ Article3

→ it

→ projectB

→ projectC

Our goal is to provide a full access to SubHome2 page and all its children, not allowing to see other pages (i.e. SubHome1, it language, etc..).
It would have been easy to grant a jcr:all privilege to SubHome2 but Adobe AEM tools are based on path browsing, consequently all folders composing the requested path must be visible to get access.
In the bullet list above  in fact, we can distinguish:

  • Green: Pages with full access
  • Orange: Pages with a partial read access (basically only the cq:Page and cq:PageContent nodes)
  • Gray: Pages not visible

To apply a security configuration like this we have to use CRX tool (under Access Control tab) and configure for each folder the policies listed below, leveraging the restriction management provided by Jackrabbit OAK (Documentation).

/ALLOW jcr:readrep:glob=Read permission to root node only
/contentALLOW jcr:readrep:glob=Read permission to content node only
/contentrep:readPropertiesRead permission to node properties (needed for CRX navigation)
/contentALLOW jcr:readrep:glob=/*/jcr:contentRead permission to see jcr:content node (for page properties)
/content/projectAALLOW jcr:readrep:glob=Read permission to projectA node only
/content/projectA/enALLOW jcr:readrep:glob=Read permission to EN node only
/content/projectA/en/SubHome2ALLOW jcr:allFull access to node section

View table on plain text format
Hint: To set an empty rep:glob value fill the input field with two double quotes (“”)

Once done final user will be able to use all standard AEM tools and properly manage his area, preserving resources outside of his focus range

Do you need help for you AEM projects?

You Might Also Like

No Comments

    Leave a Reply