I am having different hierarchy levels in my application. It is defined by one field which is nothing but 5 digit number. Each position of that digit represents hierarchy level. The left most digit represents highest level of hierarchy and hierarchy level decrease from left to right.
Hierarchy levels are as follows –
EVP – Executive Vice President
SAM – Super Area Manager
AM – Area Manager
DIVM – Division Manager
DISM – District Manager
UM – Unit Manager
For above levels I am having RoleID and RoleNamei.e. For EVP it Id is 1 and Name is EVP, for SAM ID is 2 and Name is SAM and so on so forth. Admin will have RoleID as 0.
Now we have to do section access based on RoleID i.e. For RoleID =0, i.e. Admin, will have access of whole application. For RoleID=1 i.e. EVP it will have access for that particular Section.
eg. EVP DAVE RICKELL will have access to only his data and data which is coming under his hierarchy. i.e. data belongs to SAM, AM, DIVM, DISM, UM only.