|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
If you do not want to store each one in a separate column, each right that is, you can use the serialize and unserialize functions of PHP do basically do what you described earlier.
Serialize: Returns a string containing a byte-stream representation of value that can be stored anywhere. Unserialize unserialize() takes a single serialized variable and converts it back into a PHP value. How many rights are there? If it were me I'd make a new table using the ID (which would link back to the user and be the identifier) and have a new column for each right. The right would contain an integer value of 0 or 1.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||||
|
the problem is that I will have more rights to set for each module added, so I can't have it column based, as I don't want a new module to change the base data structure, only the data structure it self will need in case of tables and so.
it might be everything from 5 to 500 different rights all depending of how many modules are added in the future... I will look into the Serialize thingie and see what that gives. |
|
|||||
|
yepp, Im bumping this thread, as I can't find a good solution on this by my self, and hope that anyone out there might have an advice for me.
I at the moment feel like I can't run further with the system I'm writing, before I know how to handle the rights part, as it is rather important and decisive for the future of the framework I'm writing. |
|
|||||
|
The real question is this:
Can you define a few basic levels, or does it have to be on a per-user basis?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
| Sponsored Links |
|
|
|
|||||
|
yes, that is the question, how to do a working structure and storage of it, both easy to read, write and modify from my code?
is it better to make boolean rights for each use, or should i make fewer with a certain level? like: booean type generates this kinda rights: read page A modify page A alter page A whatever page A or the level based of Page A: read, modify, admin etc with increasing rights... the first one take more out of the db, with storage and looping etc, but is really simpler to work with, I guess? or the second way which is easier with the db, but would need more logic in the code to interpret the rules. and, if you go with boolean type, should I store all rights with true or false, or just the set ones? what would be easiest? what would be better in a coding example, how to check if a right is ok or not etc? it's many questions, ofcourse some, Ieed to just decide much depending on my code, but it is still a few ways to go depending on what makes logical and usable. |
|
|||||
|
Perhaps a bit-string to store the permission/denial values.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [WTS] Webmaster Blog - Unique content - Good Rev - Good Price! | Talks_44 | Sites for Sale | 5 | 07-14-2008 01:32 PM |
| Good evening | Toby | Introductions | 4 | 05-03-2007 12:56 PM |
| Using change management | Cosmet | General Programming | 2 | 10-30-2006 07:16 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%