Hello @ashish_mishra1
Please try to achieve the same via rendercondition on
/libs/dam/gui/content/assets/jcr:content/actions/secondary/create/items/createfolder
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
<granite:rendercondition
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/renderconditions/simple"
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.
Examples:
granite:relativeParent("/a/b/c/d", 0) == "/a/b/c/d"
granite:relativeParent("/a/b/c/d", 1) == "/a/b/c"
Aanchal Sikka