Add sql to extend perm.