Menu

User Permissions

2000-08-17
2000-08-22
  • Philip Olson

    Philip Olson - 2000-08-17

    How many levels? 

    For example :
    - Admin
    - Webmaster
    - Moderator
    - User
    - Public
    - Suspended
    - Banned

    Or use a more "flexible" approach where , for example, there are 99 levels, 1-99, where level 1 can view 1-99, level 33 can view 33-99 , etc.

    Or are users to be assigned levels.  So, a person could have Admin rights but NOT a Moderator.

    Or ... All thoughts welcome.

     
    • Anonymous

      Anonymous - 2000-08-22

      This will show my hardware background, but... ;-)
      I think we should add a permissions field to the User class. This field would be a 1-hot bit field, where each bit represents a permission level.
      If we make this say a 32-bit number, that would allow for up to 32 permission levels. Then we can use the php bitwise AND operator to mask the permission field and act on it.
      For example, the number 0x0000 would give no permissions; and, the number 0xFFFF would give all permissions. Any bit that is clear (not a 1) would deny that permission. The web developer could then assign the permission bits as is seen fit.

      Them's mee thoughts ;-)

      -anders.

       

Log in to post a comment.