Back to Devexpress

DirectoryAccessRule Class

corelibraries-devexpress-dot-security-dot-resources-228d4110.md

latest3.9 KB
Original Source

DirectoryAccessRule Class

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

Namespace : DevExpress.Security.Resources

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public sealed class DirectoryAccessRule :
    UriAccessRule
vb
Public NotInheritable Class DirectoryAccessRule
    Inherits 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 :

csharp
// Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow());
vb
' Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow())
csharp
// Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny());
vb
' Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny())
csharp
// Image load is allowed only from the specified file directory
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("C:\StaticResources\"));
vb
' Image load is allowed only from the specified file directory
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("C:\StaticResources\"))
csharp
// 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\"));
vb
' Image load from the specified file directory is denied
' Images from other directories are accessible
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny("C:\StaticResources\"))

Implements

IUriAccessRule

IAccessRule

Inheritance

Object UriAccessRule DirectoryAccessRule

See Also

DirectoryAccessRule Members

DevExpress.Security.Resources Namespace