The PhD student must have a residence permit and a work permit before he/she is employed by the university. Employment cannot happen until the residence and work permit is settled.
The university will initiate the process of obtaining the relevant permits, but it must be completed by the PhD student. Expenses related to obtaining the permits are not covered by the university.