add potentially recursive set permissions function for file storage