Fixing redirect permissions bug