Correctly set permissions in a loop
It seems the multi-argument variant before did not work as expected.