It may be seen as a limit on the right to be a candidate, which is also protected by the charter.
All you have to be is a Canadian citizen who has reached the age of 18. It would have to be submitted to the test of whether it's reasonable under the circumstances. There may be, again, a good reason, but I think how we crafted such a prohibition would be quite critical to meet the test of being reasonable.