Script restriction

All scripts in Content Hub are restricted, and these settings cannot be modified by superusers. Restricted scripts have a limited number of permitted libraries, partially permitted libraries, as well as blocked libraries and attributes.

Warning

We recommend that you keep the total script run time below 10 minutes. After 12 minutes, the script worker considers the script stuck and starts a new worker to relaunch it. This can cause resource starvation and data inconsistency.

If you have legacy unrestricted scripts that are published and you upgrade to the latest Content Hub version, your scripts will still work. However, you will not be able to create or publish new unrestricted scripts.

Important

We recommend that you convert your legacy unrestricted scripts to restricted scripts.

Permitted libraries

Scripts can contain two types of libraries:

  • Partially permitted libraries - you can use only the items (like classes or objects) directly within that library, but not those in its nested namespaces.

  • Fully permitted libraries - you can use items from that library and all its nested namespaces.

Partially permitted libraries

Fully permitted libraries

Stylelabs.M.Base.Querying.QuerySortOrder

Newtonsoft.**

Stylelabs.M.Base.Querying.Query

Stylelabs.M.Base.Querying.Filters.**

Stylelabs.M.Base.Querying.ScrollRequest

Stylelabs.M.Base.Querying.Linq.**

Stylelabs.M.Base.Querying.Sorting

Stylelabs.M.Framework.Essentials.LoadConfigurations.**

System.Globalization.CultureInfo

Stylelabs.M.Framework.Essentials.LoadOptions.**

System.Net.HttpStatusCode

Stylelabs.M.Scripting.Types.**

System.Security.Claims.ClaimTypes

Stylelabs.M.Sdk.**

System.Globalization.DateTimeStyles

Stylelabs.M.Sdk.Fluent.**

System.*

Stylelabs.M.Sdk.Models.Localization.**

System.Threading.Tasks.*

Stylelabs.M.Sdk.Models.Typed.**

System.Numerics.*

System.Collections.Generic.**

System.Linq.**

System.Text.**

Stylelabs.M.Sdk.Search.**

Blocked libraries

You cannot use the following libraries:

  • System.Activator

  • System.Environment

  • System.GC

  • System.Threading.TaskScheduler

Blocked attributes

You cannot use the following attribute:

  • System.Type:InvokeMember

Do you have some feedback for us?

If you have suggestions for improving this article,