At which layer (Model, View, Controller) of MVC should permission logic be handled?
Let me clarify that a bit. Obviously the UI (View and Controller) need to be able to access permissions to show/hide components and to handle the permission denied scenario. It also seems obvious that the permissions should be persisted to the database by the Model layer.
But what about "complex" permission rules like this?
In a wiki/CMS system I'm developing, each user has a set of per-page permissions (view, edit, rename, etc.). For existing pages, these permissions are retrieved from the database. For a new page, the user is assumed to have all possible permissions (as they create/edit it).
Another example would be the list of pages:
The current user should only be able to see pages which they have view permission on in the list of pages.
Should the Controller handle this logic? Or should the Controller only be responsible for calling a GetPermissions() method (or GetPageList), and all the logic for populating it be handled in the Model?