Fix page permissions template permission inheritance

Permission inheritance from a page type is broken due to an outdated method $ct->getMasterTemplate();. It looks like this section wasn't updated for the new split between page types and page templates. I'm fairly certain this is correct, but someone from the core should definitely take a look at this to make sure it's the correct approach.