LPS-49818 rename method (no changes)
LPS-49818 check permissions on the target layout instead of the current one
LPS-49818 move variable closer to where it is used (no changes)