Hi,
I am developing a web-based app which has several modules and access to all these modules are based on privileges. These privileges are granted to the user at the time when he is added into the system. Now, my problem is, how can i prevent a user from moving into a module for which he has no privileges.
For example, consider two modules which consist of four pages each:
Module1:- PageA -> PageB -> PageC -> PageD; and
Module2:- PageW -> PageX -> PageY -> pageZ ....
I have prevented a user Mr.X from accessing the module "start" page, PageW, because he does not have the required privileges for Module2. But he can access PageA as he has access to Module1. In the course of going through ModuleA, Mr.X can decide to "switch" to Module2 by simply typing in the URL for PageY. This is what i want to prevent.
One way, I think, is to write the privilege_id into each page (intermediate or otherwise) and cross-check with the user's privilege at the time of access. But sometimes a page may belong to multiple privileges, and there can be other complications too.
Is there a better way to handle this?