Firstly entered row in ApplicationSettings.
Set SettingKey=Appcode.menu like nclgmgr.menu
Set SettingValue=Menu permission keys from menu definition of application.
E.g.: ID_mnu1Student,ID_Student,ID_NewStuPerson
Note: if ApplicationSettings is empty, its means all keys are available.
Step.1 Check DBrole Active or Not.
Active: At Least one row available in DBrole
Not Active: If DBrole is Empty

Step.2 If Dbrole not active then (No Need to check Dbrole)
If User is Superadmin then:

Showing all Tenant + Admin i.e. (Admin Behave=T & S) Level menu's which keys are entered in SettingValue in Applicationsettings.

If User is not Superadmin then:

Showing only Tenant i.e. (Admin Behave= T) Level menu's which keys are entered in SettingValue in Applicationsettings.

Step.3 If DBrole active then :( Now Check Dbrole first)
Now need to create DbRole, We can create dbroles like this:

Now Check Roleid in Users Table
Case.1:
If roleid =2 in users table then:
(a). if User is Superadmin then
Showing all Tenant+Admin i.e. (Admin Behave = T & S) Level menu's which keys are entered in Permissionlist in Dbrole and Applicationsettings (if keys are define in Applicationsettings.


(b).If User is not Superadmin then
Showing Only Tenant i.e. (Admin Behave = T) Level menu's which keys are entered in Permissionlist in Dbrole and Applicationsettings (if keys are define in Applicationsettings).


Case.2:
If roleid =1 in users table then:
(a).If User is Superadmin then
Showing Tenant+Admin i.e. (Admin Behave = T & S) Level menu's which keys are entered in SettingValue in Applicationsettings.


(b).If User is not Superadmin then
Showing Only Tenant i.e. (Admin Behave = T) Level menu's which keys are entered in SettingValue in Applicationsettings.

