[eluser]Bramme[/eluser]
Hello all
I'm working on a personal Auth library for my future projects and one of the features are user restrictions: some users can only access some pages, while others may access all. Because I want an administrator to be able to restrict users, I use the following system:
I enter all pages of my auth system manually to a table in the database (this works fine for now, as the number of pages remains limited). This table is also used to create the navigation for the website. This table has 6 fields (id, title, url, description, parent_url (if it's a subnav item) and order).
Then I have a users_restrictions table. This has 3 fields: id, users_id, pages_id. This table stores what pages a certain user
isn't allowed to see.
Now this works perfectly fine, but it feels kinda clunky. Especially the manual adding of pages. Does somebody have some kind of idea how I could replace the manual adding with something more automatic?