UrlAccessRule Class
A rule that allows or denies access to a URL.
Namespace: DevExpress.Security.Resources
Assembly: DevExpress.Data.v21.1.dll
NuGet Package: DevExpress.Data
Declaration
Related API Members
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"));
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UrlAccessRule class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.