Welcome Guest, Not a member yet? Register   Sign In
"Best" way to restrict users from certain pages.
#1

[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?


Messages In This Thread
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 12:35 AM
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 01:34 AM
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 02:01 AM
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 04:37 AM
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 04:47 AM
"Best" way to restrict users from certain pages. - by El Forum - 04-27-2009, 07:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB