A planning application for a new building at Ysgol Gyfun Cwm Rhondda has been approved by councillors