Skip to main content
Tab

FileManagerSettingsPermissions Class

Contains settings that relate to a ASPxFileManager’s permissions.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public class FileManagerSettingsPermissions :
    FileManagerSettingsBase

The following members return FileManagerSettingsPermissions objects:

Library Related API Members
ASP.NET Web Forms Controls ASPxFileManager.SettingsPermissions
RichEditDocumentSelectorSettings.PermissionSettings
SpreadsheetDocumentSelectorSettings.PermissionSettings
ASP.NET MVC Extensions FileManagerSettings.SettingsPermissions

Remarks

The FileManagerSettingsPermissions class contains the settings that allow you to specify the access permissions for folders and files within a file manager.

Use the ASPxFileManager.SettingsPermissions property to access a FileManagerSettingsPermissions object.

Concept

Example

Web Forms (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>

Web Forms (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);
...

MVC:

@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";

    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);
    ...
}).BindToFolder(Model).GetHtml()

Online Demo

See Also