A building permit has been granted for a Mattapan project that will include 48 units — all affordable.