Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would create two tables; users and ranks.</p> <pre><code>User ----- id username rankID Ranks ------ id makeChanges acceptChanges changePermissions view </code></pre> <p>Then just create the various ranks that you want in the Ranks table and set the rankID of the users to match the corresponding one that you want. Make sure to set in the Ranks table each field to a value of 0 or 1; with 0 being not having that ability and 1 having that option.</p> <p><strong>Edit</strong> If you were going to do this without a database then you could give do it with the classes or even instances in PHP5. For instance, let's say that you had set a name for each of the things that you had in your original post:</p> <pre><code>Creator - make changes, accept changes, change permissions Reviewer - Accept changes Editor - Make changes Regular - View </code></pre> <p>Then you could do something like below. (The database way would obviously be a much better way, but this is just an example.)</p> <pre><code>class Regular { public function View() { //Do the view stuff in here } } class Editor extends Regular implements Edit { } class Reviewer extends Regular implements Review { } interface Review { public function AcceptChanges() { //Do the accept changes here } } interface Edit { public function MakeChanges() { //Do the make changes stuff here } } class Creator extends Regular implements Edit, Review { public function ChangePermissions() { //Do the change permissions stuff here } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload