Is there a way to hide folders in file chooser right pane?
Question asked by Rhett Cawood - 11/20/2019 at 1:18 PM
Answered
I only want the allowed file type showing not allowed file type and subfolders.

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Answer
You can hide a subfolder by adding explicit denied permissions for the subfolder:

rootFolder.AccessControls.Add(
    new FileManagerAccessControl
        {
            Path = @"\Subfolder1",
            DeniedPermissions = FileManagerPermissions.Full //do not show it
        }
);
Actually we also have a wildcard feature that was added way back in v5.3.5:

Hide all subfolders with “Keyword” in name under the root folder:

rootFolder.AccessControls.Add(
    new FileManagerAccessControl
        {
            Path = @"\*Keyword*",
            DeniedPermissions = FileManagerPermissions.Full //do not show it
        }
);

Hide all subfolders with “Keyword” in name under the root folder and under the root folder’s all subfolders - recursive: 

rootFolder.AccessControls.Add(
    new FileManagerAccessControl
        {
            Path = @"\**\*Keyword*",
            DeniedPermissions = FileManagerPermissions.Full //do not show it
        }
);

So you should be able to hide any subfolder:

rootFolder.AccessControls.Add(
    new FileManagerAccessControl
        {
            Path = @"\**\*",
            DeniedPermissions = FileManagerPermissions.Full //do not show it
        }
);


Reply to Thread