corelibraries-devexpress-dot-security-dot-resources-dot-urlaccessrule-dot-deny-x28-system-dot-string-x29.md
Creates the UrlAccessRule that denies resource loading from the URLs passed as the parameter.
Namespace : DevExpress.Security.Resources
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public static UrlAccessRule Deny(
params string[] urls
)
Public Shared Function Deny(
ParamArray urls As String()
) As UrlAccessRule
| Name | Type | Description |
|---|---|---|
| urls | String[] |
An array of URLs that this rule denies. Other URLs are considered as allowed in this application.
|
| Type | Description |
|---|---|
| UrlAccessRule |
An instance of the UrlAccessRule class.
|
You can pass nothing as the method’s parameter to create a rule that denies access to all URLs:
// Image load from URLs is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Deny());
' Image load from URLs is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Deny())
Pass the URLs that should not be accessible in the application to deny resource loading from them:
// 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"));
' Image load from URLs is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(UrlAccessRule.Deny())
The following code snippets (auto-collected from DevExpress Examples) contain references to the Deny(String[]) method.
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.
reporting-asp-net-core-content-security-policy/CS/CSPExample/Startup.cs#L48
var contentDirectoryAllowRule = DirectoryAccessRule.Allow(new DirectoryInfo(Path.Combine(env.ContentRootPath, "..", "Content")).FullName);
AccessSettings.ReportingSpecificResources.SetRules(contentDirectoryAllowRule, UrlAccessRule.Deny());
DevExpress.XtraReports.Configuration.Settings.Default.UserDesignerOptions.DataBindingMode = DevExpress.XtraReports.UI.DataBindingMode.Expressions;
reporting-asp-net-core-specify-parameters-in-url-query-string/CS/ReportingApp/Startup.cs#L44
var contentDirectoryAllowRule = DirectoryAccessRule.Allow(new DirectoryInfo(Path.Combine(env.ContentRootPath, "..", "Content")).FullName);
AccessSettings.ReportingSpecificResources.SetRules(contentDirectoryAllowRule, UrlAccessRule.Deny());
var reportingLogger = loggerFactory.CreateLogger("DXReporting");
reporting-asp-net-core-specify-parameters-on-button-click/CS/ReportingApp/Startup.cs#L44
var contentDirectoryAllowRule = DirectoryAccessRule.Allow(new DirectoryInfo(Path.Combine(env.ContentRootPath, "..", "Content")).FullName);
AccessSettings.ReportingSpecificResources.SetRules(contentDirectoryAllowRule, UrlAccessRule.Deny());
var reportingLogger = loggerFactory.CreateLogger("DXReporting");
reporting-asp-net-core-customize-parameters-panel/CS/Program.cs#L47
var contentDirectoryAllowRule = DirectoryAccessRule.Allow(new DirectoryInfo(Path.Combine(builder.Environment.ContentRootPath, "Content")).FullName);
AccessSettings.ReportingSpecificResources.SetRules(contentDirectoryAllowRule, UrlAccessRule.Deny());
app.UseDevExpressControls();
reporting-asp-net-core-standalone-parameters-panel/CS/DXWebApplication1/Program.cs#L46
var contentDirectoryAllowRule = DirectoryAccessRule.Allow(new DirectoryInfo(Path.Combine(builder.Environment.ContentRootPath, "Content")).FullName);
AccessSettings.ReportingSpecificResources.SetRules(contentDirectoryAllowRule, UrlAccessRule.Deny());
app.UseDevExpressControls();
See Also