Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Hide Create Button for 2 level of folders


Level 4

The user is allowed to create any folder under Explore category. But should not be allowed to create any grandchild folder of Explore or anything below Winter, Easter, etc.


Are there any ACLs through which we can control this, or granite render condition will work here?

I am thinking of having a JS to control it eventually if a direct way is not possible.






@DEBAL_DAS @arunpatidar @SantoshSai 

3 Replies


Community Advisor

Hello @ashish_mishra1 


Please try to achieve the same via rendercondition on 



It would assure that "Create Folder" option is available only at a certain level of the hierarchy


Defining rendercondition

Adapt following to your needs. This


    expression="${granite:relativeParent(requestPathInfo.suffix, 1) != '/content/dam/abc')}"/>




granite:relativeParent(String path, int level) Returns the n-th relative parent of the path, where n=level.


granite:relativeParent("/a/b/c/d", 0) == "/a/b/c/d"
granite:relativeParent("/a/b/c/d", 1) == "/a/b/c"



Aanchal Sikka


Level 4

@aanchal-sikka Thanks, I tried this but seems some issue, it's not able to find the relative parent.


Can we use the restricted path property to match, something like 


restrictedPath = /a/b/c/*


So, it should not be visible in any folder below c but available till folder c


Community Advisor

You can use rendercondition as explained by @aanchal-sikka
If possible please avoid doing such customization as you may face issue with upgrades.