hi.
I am working in PHP Maker 12 and there is a welfare application I am developing myself. Long before i last worked in PHP maker during 2014, I implemented user level security but I forget completely because I have not done a single work in last five years.
I am working on a database which contains four steps hierarchy and I want to use security in which higher level can view all lower levels and lower levels can only view under their jurisdiction i.e. I have
(1) Head Office (which can view, add, edit Zonal Office, Regional Office and Store level)
(2) Zonal Office (which can view add, edit regional Office and Store Level)
(3) Regional Office (which can view add edit Store level)
(4) store incharge (which can only view his assigned store)I have been working since two days but I could not do any thing because I have forget how to… I have read php maker documentation and I have understood how user id can be used for user based records but I tried to implement hierarchical level security using parent id but I failed.
plz I need help…
Please post your tables schema and some records example for more discussion; so others could help you to reproduce the case.
departments
Field Type Extra
P Dept_ID int(11)
Dept_Name varchar(255) Allow Null
Parent_ID int(11) Allow Null
User_ID int(11) Allow Null
zones
Field Type Extra
P Zone_ID int(11)
Zone_Name varchar(255) Allow Null
Dept_ID int(11) Allow Null
regions
Field Type Extra
P Region_ID int(11)
Region_Name varchar(255) Allow Null
Zone_ID int(11) Allow Null
Parent_Id int(11) Allow Null
stores
Field Type Extra
P Store_No int(11) Auto Increment
Store_ID int(11) Allow Null
Region_ID int(11) Allow Null
Store_Name varchar(255) Allow Null
Store_Address varchar(255) Allow Null
Store_Type varchar(255) Allow Null
Store_GeoLocation varchar(255) Allow Null
Parent_Id int(11) Allow Nulluserlevelpermissions
Field Type Extra
P userlevelid int(11)
P tablename varchar(255)
permission int(11)
userlevels
Field Type Extra
P userlevelid int(11)
userlevelname varchar(255)
1
users
Field Type Extra
P user_code varchar(255)
user_id int(11)
user_name varchar(255) Allow Null
user_password varchar(255) Allow Null
user_type varchar(255) Allow Null
parent_id int(11) Allow Null
userlevelid int(255) Allow Null
access_id int(11) Allow Null
login_session_key varchar(255) Allow Null
email_status varchar(20) Allow Null
password_reset_key varchar(255) Allow Null
Please do not just post like that. You should dump your tables schema into. sql file; so others could run the file to create the table and populate the records in it straightforward.Example of SQL command:CREATE TABLE … (for creating tables)INSERT INTO … (for populate the records into the tables)