This is my third attempt at answering as my other two got as far as posting and for some unknown reason I got logged out before it posted successfully. So this is a much shortened version of my first answer as I am now fed up........
A resident is not neccessarily a citizen. By permanent resident, I think you mean someone with ILR ? Someone with ILR who does not meet the criteria listed below cannot vote or stand for public office.
To be allowed to vote in a Parliamentary or a local or a European election you must have your name on the Electoral register.
To be allowed to have your name on the Electoral register you must be aged 18 or over and you must be a citizen of the United Kingdom, or a citizen of the Commonwealth, or a citizen of a European member state.
Citizens of the UK, the Commonwealth and the Irish Republic that are resident in this country may vote in ALL public elections. Citizens of EU member states that are resident in the UK can vote in all BUT the national parliamentary elections.
To stand for public office you must be a citizen of the UK, or the Commonwealth or a citizen of the Irish Republic, aged 21 or over. There are some exceptions including Peers, civil servants, members of the armed forces and those with certain criminal convictions.
To become a local councillor you must have a local connection with the area. Either through work or being on the electoral register for that area or owning land or property.
This rule does not apply to MP's, MEP's , MSP's or members of the Welsh or Northern Ireland assemblies.
Hope this helps!