allow layer replace to respect the current permissions
Merge pull request #873 from simod/replace-permissions

allow layer replace to respect the current permissions