How can I to restrict users from seeing some folders and files under rootPath of xtype pathfield of CQ AEM?

1k Views Asked by At

This is a question about the interesting world of AEM.

In dialog box, I want user to allow to select any sub folders and files except certain files or folders.

My jcr refContent in the xml looks like below. I want user to be able to select and also see some folders under /content/mainfolder AND not see some folders & filder there. https://docs.adobe.com/docs/en/aem/6-1/ref/widgets-api/index.html

I do not seem to find any solution. Any ideas/help please is greatly appreciated.

<refContent
        jcr:primaryType="cq:Widget"
        fieldDescription="Mandatory field. Select a page"
        fieldLabel="Content reference"
        itemCls="mandatory-field"
        name="./refContent"
        key="refContent"
        componentClass="refContent"
        rootPath="/content/mainfolder"
        xtype="pathfield"/>
1

There are 1 best solutions below

3
Mohit Bansal On

This can be managed by providing correct permission to users. For folders which you dont want user to access, remove read permission for this user. Hope this will help.