updated transformer to use all masks for each permission