The department shall have the power, and it shall be its duty:
All sums credited to any inmate and not paid to a dependent or dependents shall be paid to the inmate on his discharge from the penitentiary, reformatory, or other institution in which he was a prisoner: Provided, however, That, subject to the rules and regulations of the Board of Inspectors or managers of the penitentiary, reformatory, or other institution in which such inmate is a prisoner, the whole or any part of said sum may be paid to him during his imprisonment for his present needs; such rules and regulations to be subject to the approval of the department.
71 P.S. § 1481