WIP: Fix tests on `security-9-2-ee`

Closed username-removed-642931 requested to merge system_9_2_security_test_for_ce_to_ee into master

What does this MR do?

Attempts to sync an EE specific security change that needs some CE magic to work.

9.2.2 - 9.2.5 EE security fix

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Sync security to public master

What are the relevant issue numbers?