FileManagerFolderAccessRule.Browse Property
Gets or sets the browse action permission.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Default | Description |
---|---|---|
Rights | Default | A Rights enumeration value that specifies 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. |
#Remarks
Use File Manager access rules (the FileManagerSettingsPermissions.AccessRules collection) to define a user’s access permissions for folders and files. A folder access rule specifies a folder path where the rule is applied and a permission that is an allowed or denied action associated with this rule.
Use the Browse
property to specify whether end users of the specified role (FileManagerAccessRuleBase.Role) can browse a folder specified in the current access rule. To specify the folder, set the FileManagerFolderAccessRule.Path property.
If the Browse
property is set to Rights.Deny
, the folder and its contents are invisible for the current user.
The code samples below demonstrate how to specify the Browse
permission.
Web Forms (in markup):
<dx:ASPxFileManager ID="ASPxFileManager1" runat="server">
<SettingsPermissions>
<AccessRules>
<dx:FileManagerFolderAccessRule Role="Administrator" Browse="Allow" Path="Documents" />
</AccessRules>
</SettingsPermissions>
</dx:ASPxFileManager>
Web Forms (in code):
ASPxFileManager fm = new ASPxFileManager();
...
FileManagerFolderAccessRule folderRule = new FileManagerFolderAccessRule();
folderRule.Role = "Administrator";
folderRule.Path = "Documents";
folderRule.Browse = Rights.Allow;
FileManager.SettingsPermissions.AccessRules.Add(folderRule);
...
MVC:
@Html.DevExpress().FileManager( settings => {
settings.Name = "fileManager";
FileManagerFolderAccessRule folderRule = new FileManagerFolderAccessRule();
folderRule.Role = "Administrator";
folderRule.Path = "Documents";
folderRule.Browse = Rights.Allow;
FileManager.SettingsPermissions.AccessRules.Add(folderRule);
...
}).BindToFolder(Model).GetHtml()
#Concept
#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>