_securityContextService.ActAsSystem() When to use?

After the update, we get some error when we user CRUD on services. Like Base product and Variant and so on. Now after update to the latest, we get many errors when we did not use _securityContextService.ActAsSystem() before. Where can I find the information I need on when I need it and when I don’t need it.

Litium version: 7.*

Code is executed using the current users permissions, or if not logged in, the anonymous user. When creating or updating entities you need to act as a system user to not throw the exception.

I don’t believe there exists any documentation on exactly where, but in general it should be used when updating entities from Websites, Products, Customers and Media.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.