Skip to main content
Tab

FileManagerSettingsPermissions.Role Property

Gets or sets a security role that is enforced on the ASPxFileManager.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

[DefaultValue("")]
public string Role { get; set; }

Property Value

Type Default Description
String String.Empty

A String value specifying a security role name.

Property Paths

You can access this nested property as listed below:

Remarks

The file manager allows you to associate any number of access rules with specific security roles to group related permissions together. To associate an access rule with a security role, assign the role’s name to the rule’s FileManagerAccessRuleBase.Role property.

Any created role can be enforced on the ASPxFileManager via its Role property. After that, the file manager will display the folder and files and provide access permissions to them based on the assigned role.

Concept

Online Demo

Example

<dx:ASPxRadioButtonList ID="rblRole" runat="server" AutoPostBack="true" SelectedIndex="0"  OnValueChanged="rblRole_ValueChanged">
        <Items>
            <dx:ListEditItem Text="Default User" Value="" Selected="True" />
            <dx:ListEditItem Text="Document Manager" Value="DocumentManager" />
            <dx:ListEditItem Text="Media Moderator" Value="MediaModerator" />
            <dx:ListEditItem Text="Administrator" Value="Administrator" />
        </Items>
</dx:ASPxRadioButtonList>

<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>
protected void rblRole_ValueChanged(object sender, EventArgs e) {
     FileManager.SettingsPermissions.Role = (string)rblRole.Value;
}
See Also