Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

32-role limit

13»

Comments

  • ToddTodd Vanilla Staff
    @Lincoln, Who DOESN'T love bitmasks?
  • SS ✭✭
    My live example.

    We have a dealership network of shops, customer (client) can send a request for order in this shop.
    Each usual manager in shop can view only self shop's requests (and probably (administrative manager) all requests in city, depends of the type of dealer).
    So, at this time, totally we have 233 shops in 120 cities.
    Should I create 233 roles? Each role for shop, plus 120 roles for cities?

    Nope.
    Actually, we have 1 role (Manager) for all 1000+ managers in 233 shops and 120 cities (with middle table solution which I mentioned above).
    Imagine how it will look page http://site.com/user/edit/1 with 353 role checkboxes.

    You say 900 roles? Obscurantism.

    If application (forum, cms, etc.) requires more than 5-6 roles I bet that structure of this application is wrong. [Limit of 32 is forcing to think about correct structure]

    Moderator, Moderator of Games, Moderator of Movies, Moderator of Soft.
    It is FOUR different roles or same (ONE)?
  • LincLinc Admin
    Sure, an app shouldn't have more than 5-6 roles. What happens after you're running 10 apps? :)
  • SS ✭✭
    edited July 2010
    10 Apps ;) Why not 200?
    Tell me at least 5 apps which requires 5-6 specific roles.
    Most will be reusable (Guest, Member, Editor, Admin).
  • ToddTodd Vanilla Staff
    The power of two thing was to allow for the possibility of doing a query based on a bitmask. However that's not really straight-forward querying and would only be using a database index for its in-memory properties, rather than its sorted properties.

    Furthermore, there is other functionality we are thinking about which will require filtering on categories in different ways than permissions so at the end of the day having the database structure straightforward and doing optimization with caching down the line is the way we want to go.

    We won't be including the functionality to force you to have 100 roles. Don't worry.
Sign In or Register to comment.