LPS-45001 Modifying permission check query