Skip to main content
A newer version of this page is available. .

DirectoryAccessRule.Allow(String[]) Method

Creates the DirectoryAccessRule that allows resource loading only from the file directories passed as the parameter.

Namespace: DevExpress.Security.Resources

Assembly: DevExpress.Data.v19.1.dll

Declaration

public static DirectoryAccessRule Allow(
    params string[] directories
)

Parameters

Name Type Description
directories String[]

An array of file directories that this rule allows. Other directories are considered as denied in this application.

Returns

Type Description
DirectoryAccessRule

An instance of the DirectoryAccessRule class.

Remarks

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

// Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow()); 

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

// Image load is allowed only from the specified file directories.
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("http://mysite.dev"));
See Also