For completeness you should add aLayer.positionLocked = false;
The lock types are independent of each other. You can have a layer with both positionLocked and allLocked set to true. Setting allLocked to false in that case would still leave the layer positionLocked and throw an error.