# Update Security Level Configuration via Script

**URL:** <https://forum.inductiveautomation.com/t/update-security-level-configuration-via-script/112369>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [November 21, 2025, 9:20pm UTC](https://forum.inductiveautomation.com/t/update-security-level-configuration-via-script/112369 "2025-11-21T21:20:32Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 21, 2025, 11:20pm UTC](https://forum.inductiveautomation.com/t/update-security-level-configuration-via-script/112369/7 "2025-11-21T23:20:14Z")

</div>

Regarding library scripts:

> [@How to develop/debug scripts on gateway](https://forum.inductiveautomation.com/t/how-to-develop-debug-scripts-on-gateway/81319/17):
>
> The reasons are, to start:
> 
> - Functions in the project library are re-usable. When carefully designed, they can be used in many parts of your application.
> - Functions in the project library can re-use constants and cached values that are stored in named variables **outside** the `def`. This **does** reduce execution time, as those variables persist from call to call.
> - Functions in the project library are maintenance-friendly, particularly that they are stored in the filesystem in plain text as `code.py`, and are therefore very friendly to source code control, like `git`.

The 2nd point is especially important when using `system.net.httpClient`, where you want to be reusing the same instance as much as possible instead of creating a new one each time you do something.

There are also some legacy scoping issues that you get around by having functions defined in the project library script and calling them from events.

Regarding imports:

> [@What external tools do you use for Ignition development, and why?](https://forum.inductiveautomation.com/t/what-external-tools-do-you-use-for-ignition-development-and-why/93759/71):
>
> Be aware that `import` always takes the interpreter's modules lock

> [@What external tools do you use for Ignition development, and why?](https://forum.inductiveautomation.com/t/what-external-tools-do-you-use-for-ignition-development-and-why/93759/71):
>
> All use of `import` should be in project library scripts at the outermost level, never inside function definitions, or performance will suffer.

Basically, the trade off between locking once for an import when first initializing the project library script vs locking every time the function is called. Someone else might be able to explain it in further detail.

---

_[View the full topic](https://forum.inductiveautomation.com/t/update-security-level-configuration-via-script/112369)._
