Skip to main content

DirectoryAccessRule Class

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

Namespace: DevExpress.Security.Resources

Assembly: DevExpress.Data.v22.2.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\")); 

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DirectoryAccessRule class.

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.

Inheritance

Object
UriAccessRule
DirectoryAccessRule
See Also