Fix permission factory