• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[PHP]Multy-level Access Panel

(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Okay so I am going to code a backend panel with multy-level access. Basically like Admin, Manager, Operator, Worker...

I would like yo know what things I should consider so I won't run into a trouble later. So far I have things kinda planned but would like to get your guys input.

Thanks
 
Newbie Spellweaver
Joined
Mar 19, 2008
Messages
47
Reaction score
14
Sounds very nice, I am interested in speaking to you about a little project I have.

Come on skype bro ^^
 
ex visor
Loyal Member
Joined
May 17, 2007
Messages
2,741
Reaction score
937
Well, if I get this correctly, then you want to authorize certain authority masks to certain parts of the panel, which is easy.

What my friend and I did, was setup a row in the "user" table, or whatever you use, and use 1-1-1-1-1-

Each "1", represents access to each particular section. Which, you can obvious explode to check and do i++ foreach(){}, blah to ensure the proper authority.

We also stored each CATEGORY in the database. The categories are what the 1's represent. The links to the specific category were stored in another table. Obviously if they don't have access to that CATEGORY, if they try going directly to the link, their access will be denied.

For instance:
1- = Access to the panel
1-1- = User database or something

If it's only 1-, they have access to the panel, but don't have access to view, or access anything else in the panel.

Obviously if the row is NULL, they can't access poop.

That's one way of doing it, which works well for me, anyway.
 
Ginger by design.
Loyal Member
Joined
Feb 15, 2007
Messages
2,340
Reaction score
653
Well, if I get this correctly, then you want to authorize certain authority masks to certain parts of the panel, which is easy.

What my friend and I did, was setup a row in the "user" table, or whatever you use, and use 1-1-1-1-1-

Each "1", represents access to each particular section. Which, you can obvious explode to check and do i++ foreach(){}, blah to ensure the proper authority.

We also stored each CATEGORY in the database. The categories are what the 1's represent. The links to the specific category were stored in another table. Obviously if they don't have access to that CATEGORY, if they try going directly to the link, their access will be denied.

For instance:
1- = Access to the panel
1-1- = User database or something

If it's only 1-, they have access to the panel, but don't have access to view, or access anything else in the panel.

Obviously if the row is NULL, they can't access poop.

That's one way of doing it, which works well for me, anyway.

It'd be better to make a permissions table mapping user/group -> access flags, then merely collect their permissions upon log-in and collate them under an array so you can easily test against them while making decisions in code.
 
ex visor
Loyal Member
Joined
May 17, 2007
Messages
2,741
Reaction score
937
Well, that's what I do, but for the server I run, we base it off of the group/authority of that certain group of people.

I was just explaining the general idea of how I do it, lul. ^^;
 
Back
Top