Back to Devexpress

DirectoryAccessRule.Deny(String[]) Method

corelibraries-devexpress-dot-security-dot-resources-dot-directoryaccessrule-dot-deny-x28-system-dot-string-x29.md

latest2.8 KB
Original Source

DirectoryAccessRule.Deny(String[]) Method

Creates the DirectoryAccessRule that denies resource load from the file directories passed as the parameter.

Namespace : DevExpress.Security.Resources

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static DirectoryAccessRule Deny(
    params string[] directories
)
vb
Public Shared Function Deny(
    ParamArray directories As String()
) As DirectoryAccessRule

Parameters

NameTypeDescription
directoriesString[]

An array of file directories that this rule denies. Other directories are considered as allowed in this application.

|

Returns

TypeDescription
DirectoryAccessRule

An instance of the DirectoryAccessRule class.

|

Remarks

You can pass nothing as the method’s parameter to create a rule that denies access to all file directories:

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())

Pass the file directories that should not be accessible in the application to deny resource loading from them:

csharp
// Image load from the specified file directories is denied. Images from other directories are accessible.
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny("http://mysite.dev"));
vb
' Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny())

See Also

DirectoryAccessRule Class

DirectoryAccessRule Members

DevExpress.Security.Resources Namespace