Class DeliveryApiSettingsExtensions
Provides extension methods for determining whether content types or content items are allowed to be exposed through the Delivery API based on the configured allow and disallow lists.
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Core.dll
Syntax
public static class DeliveryApiSettingsExtensions
Methods
View SourceIsAllowedContentType(DeliveryApiSettings, string)
Determines whether a content type alias is allowed to be exposed through the Delivery API.
Declaration
public static bool IsAllowedContentType(this DeliveryApiSettings settings, string contentTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| DeliveryApiSettings | settings | The Delivery API settings. |
| string | contentTypeAlias | The content type alias to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
If the allow list is configured (non-empty), only content types in the allow list are permitted. The allow list takes precedence - if a content type is in both allow and disallow lists, it is allowed. If the allow list is empty, all content types are allowed except those in the disallow list.
IsAllowedContentType(DeliveryApiSettings, IPublishedContent)
Determines whether a content item is allowed to be exposed through the Delivery API.
Declaration
[Obsolete("Please use the overload of IsAllowedContentType taking a content type alias. Scheduled for removal in Umbraco 19.")]
public static bool IsAllowedContentType(this DeliveryApiSettings settings, IPublishedContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| DeliveryApiSettings | settings | The Delivery API settings. |
| IPublishedContent | content | The content item to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
IsDisallowedContentType(DeliveryApiSettings, string)
Determines whether a content type alias is disallowed from being exposed through the Delivery API.
Declaration
[Obsolete("Please use IsAllowedContentType and negate the result instead. Scheduled for removal in Umbraco 19.")]
public static bool IsDisallowedContentType(this DeliveryApiSettings settings, string contentTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| DeliveryApiSettings | settings | The Delivery API settings. |
| string | contentTypeAlias | The content type alias to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
IsDisallowedContentType(DeliveryApiSettings, IPublishedContent)
Determines whether a content item is disallowed from being exposed through the Delivery API.
Declaration
[Obsolete("Please use IsAllowedContentType and negate the result instead. Scheduled for removal in Umbraco 19.")]
public static bool IsDisallowedContentType(this DeliveryApiSettings settings, IPublishedContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| DeliveryApiSettings | settings | The Delivery API settings. |
| IPublishedContent | content | The content item to check. |
Returns
| Type | Description |
|---|---|
| bool |
|