LPS-35738 fix permission checking