[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Collapse]File Management
   [Expand]Product Information
   [Collapse]File Manager
     ASPxFileManager Overview
    [Collapse]Concepts
      Thumbnails
      View Modes
      Custom Columns
      Toolbar
      Adaptivity
      Uploading Files
      File Download
      Context Menu
     [Collapse]Access Control Overview
       Access Rules
       Permissions
     [Expand]File System Providers
      Security Considerations
    [Expand]Visual Elements
    [Expand]Member Tables
    [Expand]Examples
   [Expand]File Upload
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Access Rules

This topic illustrates how to define security permissions for folders and files using a set of folder/file access rules (the FileManagerSettingsPermissions.AccessRules collection). Indexing rules within a collection allow you to control the rules' priority. A rule with a higher index has a higher priority.

Note

Refer to the Permissions topic for details on how to permit or deny access to individual files and folders or to implement complicated user access logic.

To set up access rules for folders (including their files and sub-folders) and individual files, use the FileManagerFolderAccessRule and FileManagerFileAccessRule elements. The table below lists the access rule properties that are available for files and folders.

Rule Properties File Access Rule Folder Access Rule Description
Path + + A path to which the rule is applied
Role + + A role to which the rule is applied
Browse + + Permission to view a file/folder
Download + - Permission to download a file
Edit + + Permission to edit a file/folder and its content (for folders)
Edit Content - + Permission to edit folder content
Upload - + Permission to upload files to a folder

The following Rights enumeration values determine permissions:

Value Description
Allow Rights.Allow The action is allowed within the access rule.
Deny Rights.Deny The action is denied within the access rule.
Default Rights.Default The action has the same permission as the current item (file or folder) parent element. It corresponds to the Rights.Allow permission if this value does not exist.

You can associate access rules with specific security roles and group related permissions by assigning the role's name to the rule's Role property. Related access rules should be assigned to matching role names.

Use the FileManagerSettingsPermissions.Role property to apply any created role to the ASPxFileManager. After that, the file manager displays folders and files and provides access permissions to them based on the assigned role.

Note

Expanded Examples

How to deny editing files except for JPG files:

How to deny browsing the 'Admin' folder:

How to deny editing the 'ReadOnly' folder:

How to deny uploading any folders except the 'UploadFolder' folder:

How to deny non-admin users permission to edit files:

View the Demo

Refer to the ASPxFileManager - Access Control online demo see this feature in action.

Is this topic helpful?​​​​​​​