ASPxFileManager.SettingsPermissions Property
Provides access to settings that relate to the ASPxFileManager’s permissions.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
FileManagerSettingsPermissions | A FileManagerSettingsPermissions object containing settings. |
Remarks
ASPxFileManager allows you to define access permissions for folders and files using a set of folder/file access rules (see the file manager’s FileManagerSettingsPermissions.AccessRules collection). Use the FileManagerSettingsPermissions.Role property to specify a rule’s role.
Concept
Example
In markup:
<dx:ASPxFileManager ID="ASPxFileManager1" runat="server">
<SettingsPermissions>
<AccessRules>
<dx:FileManagerFileAccessRule Edit="Deny" Browse="Allow" Path="*.docx" />
<dx:FileManagerFolderAccessRule Role="Administrator" EditContents="Allow" Browse="Allow" Path="Documents" />
</AccessRules>
</SettingsPermissions>
</dx:ASPxFileManager>
In code:
ASPxFileManager fm = new ASPxFileManager();
...
FileManagerFileAccessRule fileRule = new FileManagerFileAccessRule();
fileRule.Path = "*.docx";
fileRule.Edit = Rights.Allow;
fileRule.Download = Rights.Allow;
FileManagerFolderAccessRule folderRule= new FileManagerFolderAccessRule();
folderRule.Role = "Administrator";
folderRule.EditContents = Rights.Allow;
folderRule.Browse = Rights.Allow;
FileManager.SettingsPermissions.AccessRules.Add(fileRule);
FileManager.SettingsPermissions.AccessRules.Add(folderRule);
...
Online Demo
Example
<dx:ASPxFileManager ID="FileManager" runat="server" ...>
...
<SettingsPermissions>
<AccessRules>
<dx:FileManagerFolderAccessRule Path="" Edit="Deny" />
<dx:FileManagerFileAccessRule PathPattern="*.xml" Edit="Deny" />
<dx:FileManagerFolderAccessRule Path="System" Browse="Deny" />
<dx:FileManagerFolderAccessRule Path="Documents" Role="DocumentManager" EditContents="Allow" />
<dx:FileManagerFolderAccessRule Path="Music" Role="MediaModerator" EditContents="Allow" />
<dx:FileManagerFolderAccessRule Path="Video" Role="MediaModerator" EditContents="Allow" />
<dx:FileManagerFolderAccessRule Path="" Role="MediaModerator" Upload="Deny" />
<dx:FileManagerFolderAccessRule Role="Administrator" Browse="Allow" />
<dx:FileManagerFolderAccessRule Role="Administrator" Edit="Allow" />
</AccessRules>
</SettingsPermissions>
</dx:ASPxFileManager>
See Also