LPS-45320 Fix wrong permission check