Validating Master Parameters

Hello, folks

Almost every request the user makes includes what I am calling Master Parameters. This is a $_GET parameter that selects a single record. Often it will just be the ‘id’ parameter in something like:


Here, 'id' selects for a single master Post.   But there could be more than one master, like here:


Here, two master parameters tell us the Company and Department to add the Employee into.  Another parameter, 'mode' is not a Master Parameter, because it does not select for a particular record.

It would be nice if, before an action started, all master parameters were checked to exist, be consistent with each other, and perhaps loaded up and access checked. Then the action could focus on using the data rather than validating it. It sounds a lot like how form validating is centralized in CModel.rules() or how access is controlled in CController.accessRules(). Any thoughts on what direction to take this for a centralized, clear solution?