though with changes, for example illegitimate sons could no longer claim part of the inheritance, which Welsh law had allowed them to do. In 1301, this modified principality was bestowed on the English monarch's heir apparent and thereafter became the territorial endowment of the heir to the throne. There were few attempts by the English parliament to legislate in Wales and the lands of the Principality remained subject to laws enacted by the king and his council. However, the king was prepared to allow Parliament to legislate in emergencies such as treason or rebellion. An example was the Penal Laws against Wales 1402 enacted to contain the Glyndŵr Rising and which, inter alia, prohibited the Welsh from intermarrying with the English or owning land in England or the Welsh boroughs. Some Welshman who were loyal to the Principality successfully petitioned for exemption from the penal laws. An example was Rhys ap Thomas ap Dafydd of Carmarthenshire who was a royal official in the southern part of the Principality. Castles, towns and colonisation Edward's main concern following the conquest was to ensure the military security of his new territories and the stone castle was to be the primary means for achieving this. Under the supervision of James of Saint George, Edward's master-builder, a series of imposing castles was built, using a distinctive design and the most advanced defensive features of the day, to form a "ring of stone" around the northern part of the principality. Among the major buildings were the castles of Beaumaris, Caernarfon, Conwy and Harlech. Aside from their practical military role, the castles made a clear symbolic statement to the Welsh that the principality was subject to English rule on a permanent basis. Outside of urban areas, the principality retained its Welsh character. Unlike in some of the newly created Marcher lordships, such as Denbigh, there was little evidence of successful colonisation of rural areas by English settlers. For the royal shires, Edward established a series of new towns, usually attached to one of his stone castles, which would be the focus of English settlement. These “plantation boroughs”, often with the castle constable as town mayor, were populated by English burgesses and acted as a support for the royal military establishment as well as being an anglicizing influence. Examples include Flint, Aberystwyth, Beaumaris, Conwy, and Caernarfon. The boroughs were given economic rights over the surrounding Welsh rural areas