I have a database setup like this (I know it isnt the best setup but its out of my power to change it :-(
Basically there are 3 levels of users - Admin - Managers - Staff
Few notes: -Each member of staff belongs to department -If the Staffs logon_code appears in the manager table they are a Manager, otherwise they are a member of staff -If the staffs logon_code appears in the manager table and SystemAdmin is set to 1, they are Admin
Nasıl yeryüzünde bu ACL / Auth ayarlama yaparsınız? Herhangi bir fikir?
CREATE TABLE tblStaff (
StaffID int(11) NOT NULL auto_increment,
dept_id varchar(5) default NULL,
logon_code char(10) NOT NULL,
forename char(50) NOT NULL,
surname char(50) NOT NULL,
PRIMARY KEY (StaffID),
) ;
CREATE TABLE tblManager (
ManagerID varchar(15) NOT NULL,
logon_code varchar(15) NOT NULL,
dept_id varchar(5) NOT NULL,
SystemAdmin tinyint(1) unsigned default NULL,
PRIMARY KEY (ManagerID)
) ;
CREATE TABLE tblDepartment (
dept_id varchar(5) NOT NULL,
sect_id varchar(50) default NULL,
subsect_id varchar(50) default NULL,
sect_name varchar(50) default NULL,
sect_abbr varchar(50) default NULL,
subsect_name varchar(50) default NULL,
PRIMARY KEY (dept_id)
) ;