FileManagerAccessRuleBase.Edit Property
Gets or sets the edit action permission.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v18.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Rights | **Default** | One of the Rights enumeration values specifying the action permission. |
Available values:
Name | Description |
---|---|
Allow | The action is allowed within the access rule. |
Deny | The action is denied within the access rule. |
Default | The action has an identical permission as the current item (file or folder) parent element. It corresponds to the Rights.Allow permission if this value does not exist. |
Remarks
ASPxFileManager allows you to define access permissions for folders and files using a set of file/folder access rules (FileManagerSettingsPermissions.AccessRules). An access rule specifies a path to which it is applied and lists permissions (allowed or denied actions) associated with this rule.
Use the Edit property to specify whether end-users with the specified role (FileManagerAccessRuleBase.Role) can edit (move, rename, and delete) a file/folder specified in the current access rule via the FileManagerAccessRuleBase.Path property.
Concept
Example
WebForms (declaratively):
<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>
WebForms (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
Example
<dx:ASPxFileManager ID="FileManager" runat="server" ...>
...
<SettingsPermissions>
<AccessRules>
<dx:FileManagerFolderAccessRule Path="" Edit="Deny" />
<dx:FileManagerFileAccessRule Path="*.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" Edit="Allow" Browse="Allow" />
</AccessRules>
</SettingsPermissions>
</dx:ASPxFileManager>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Edit property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.