Hi Mahesh,
Greetings from Syncfusion support.
We have checked your reported query about access rules in FileManager component. You can define the access rules in controller. Using access control, you can restrict the access permission of user based on the role.
Refer the below code snippet for defining the access rules.
public HomeController()
{
this.operation.RootFolder(HostingEnvironment.MapPath("~/Content/Files"));
this.operation.SetRules(GetRules());
}
public AccessDetails GetRules()
{
AccessDetails accessDetails = new AccessDetails();
List<AccessRule> folderRule = new List<AccessRule> {
// For Default User Read and write permisions is deny for documents folder.
new AccessRule { Path = "/Documents", Role = "Document Manager", Read = Permission.Deny, Write = Permission.Deny, Copy = Permission.Allow, WriteContents = Permission.Allow, Upload = Permission.Allow, Download = Permission.Deny },
new AccessRule { Path = "/Documents/*", Role = "Document Manager", Read = Permission.Allow, Write = Permission.Allow, Copy = Permission.Allow, WriteContents = Permission.Allow, Upload = Permission.Allow, Download = Permission.Allow },
};
accessDetails.AccessRules = folderRule;
accessDetails.Role = "Document Manager";
return accessDetails;
} |
For your reference, we have prepared a sample with access control functionality in FileManager component.
We have considered update our documentation with more information on Access control support in File Manager in our upcoming release.
Please let us know, if you need any further assistance.
Regards,
Shameer Ali Baig S.