UrlAccessRule.Allow(String[]) Method

Creates the UrlAccessRule rule that allows resource loading only from the URLs passed as the parameter.

Namespace: DevExpress.Security.Resources

Assembly: DevExpress.Data.v20.1.dll

Declaration

public static UrlAccessRule Allow(
    params string[] urls
)
Public Shared Function Allow(
    ParamArray urls As String()
) As UrlAccessRule

Parameters

Name Type Description
urls String[]

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

Returns

Type Description
UrlAccessRule

An instance of the UrlAccessRule class.

Remarks

You can pass nothing as the method's parameter to create a rule that allows access to all URLs:

// Image load from URLs is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Allow()); 

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

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