A council has granted itself planning permission to build two large blocks of flats on a key approach to its town centre.