Skip to main content

UrlAccessRule Class

A rule that allows or denies access to a URL.

Namespace: DevExpress.Security.Resources

Assembly: DevExpress.Data.v24.2.dll

Declaration

public sealed class UrlAccessRule :
    UriAccessRule

The following members return UrlAccessRule objects:

Remarks

Define a UrlAccessRule to allow or deny resource load from all/specific URLs. You can use the static Allow(String[]) or Deny(String[]) method to create URL access rules. Use the SetRules(IAccessRule[]) method to register these rules in your application.

Examples:

// Image load from URLs is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Allow());
// Image load from URLs is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Deny());
// Image load is allowed only from the specified URL
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Allow("http://mysite.dev"));
// Image load from the specified URL is denied
// Images from other URLs are accessible
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Deny("http://mysite.dev")); 

Inheritance

Object
UriAccessRule
UrlAccessRule
See Also