Skip to main content

DirectoryAccessRule Class

A rule that allows or denies access to a file directory.

Namespace: DevExpress.Security.Resources

Assembly: DevExpress.Data.v24.1.dll

NuGet Package: DevExpress.Data

Declaration

public sealed class DirectoryAccessRule :
    UriAccessRule

The following members return DirectoryAccessRule objects:

Remarks

Define a directory access rule to allow or deny resource load from all/specific file directories in your application. You can use the static Allow(String[]) or Deny(String[]) method to create directory access rules. Use the SetRules(IAccessRule[]) method to register these rules.

Examples:

// Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow());
// Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny());
// Image load is allowed only from the specified file directory
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("C:\StaticResources\"));
// Image load from the specified file directories is denied
// images from other file directories are accessible
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny("C:\StaticResources\")); 

Inheritance

Object
UriAccessRule
DirectoryAccessRule
See Also