I'm writing a simple web application that allows users to login on different levels. Example:
- admin: may access to everything in read/write
- manager: some sections are in read/only
- operator: only few sections available
I'm using CakePHP, by the way. As far as I understand there two main approaches to handle such a different UI interactions:
on login, redirect the controllers to different prefixes (i.e. /admin, /manager, etc...).
on login, set a variable to store the current user level and add conditional instructions where needed
I'm not asking what is better (that would be just an opinion) but when it's desirable to use one and when the other approach.
My thoughts: the first way should be used when you have a lot of different things to handle. It would be acceptable to create copies of Pages and Controllers because you can better customize each one.
On the other hand, if you just need to hide or disable a couple of buttons it would easier to maintain a single copy of the files and live with some