I was thinking something along the lines of CHMOD but that might not be the best idea mostly because i don't know how to test for it.
what i wanted to know is how to design the permissions system. setting it is trivial. if anything i could set it as a 32int and bit flag their permissions. jeez, now that i think of it that would work great in C++ but can i do that in PHP? that's just another question now lmao
but checking for it w/o having to do like 300 checks to make sure that they are the right role with the correct permission. it's a pretty complicated system because i've set up the account architecture to have multiple types of accoutns (admin/mod/editor/author/user) and then there are sub accounts from within that. then i planned to set permissions to that as well so that the main admin (god admin) can set the bottom personnel to have different permissions.
for instance. you install forums onto my framework. the god admin sets the roles for the forums. he wants 20 admins (more than excessive i know) and 40 mods. then he install the estore and then again he assigns roles for them in the same fashion. mixing and matching the previous admins and completely new admins and same for the mods.
now, you have all these roles but now you need to set thier permissions. for instance the god admin doesn't want to allow all the admins to change the offtopic forum name. only one. and he does the same for all the forums. the mods take care of the users and posts and threads within the system.
so there are now set permissions for each personnel type.
users we can figure out on our own. no problems.
so that being said how could i check for permissions? checking for roles is easy enough but then you have to check permissions.
now, the question. after I've setup which roles can do what, how do i check within the code thier permissions for what they are allowed to do. that one account?
any good ideas?
Permissions System Design. Want feedback
Moderator: General Moderators
- MrPotatoes
- Forum Regular
- Posts: 617
- Joined: Wed May 24, 2006 6:42 am
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I posted a solution to the "bit" problem here:
viewtopic.php?p=282876#282876
I've done this before and then all I need to store in the DB is an integer in the users table which contains the bits set for that user. vBulletin uses the same system.
EDIT | In fact that whole thread is similar to this one
It's like 3 below this thread, just not very well titled 
viewtopic.php?p=282876#282876
I've done this before and then all I need to store in the DB is an integer in the users table which contains the bits set for that user. vBulletin uses the same system.
EDIT | In fact that whole thread is similar to this one
- MrPotatoes
- Forum Regular
- Posts: 617
- Joined: Wed May 24, 2006 6:42 am
thank you. i actually looked this over and i think i'm going to go with RBAC or GACL style permissions system combined with roles. i've got alot of work to go ahead and do.
thing is that it's not completely nesseary right now but soon (very soon) it will be. i've just got to add a 2 more plugins and since it's all still alpha i don't need to go crazy with the user stuff. heck, i left it open in all honesty. it's just kinda there. THEN i'll add it
yeah, well labeled and spell checked stuff is nice.
but that bit stuff helps. thanx
thing is that it's not completely nesseary right now but soon (very soon) it will be. i've just got to add a 2 more plugins and since it's all still alpha i don't need to go crazy with the user stuff. heck, i left it open in all honesty. it's just kinda there. THEN i'll add it
yeah, well labeled and spell checked stuff is nice.
but that bit stuff helps. thanx