Reply to Re: permission groups

Your name:

Reply:


Posted by linda on 11/19/06 01:40

"J.O. Aho" <user@example.net> wrote in message
news:4s9k9tFug231U1@mid.individual.net...
> linda wrote:
>> "J.O. Aho" <user@example.net> wrote in message
>
>>> If we assume you would store page data, then you can have
>>>
>>> Permissions
>>> user_id
>>> page_id (string to identify page)
>>> perm (bool value)
>>
>> but would you mind explaining how the above would work, I'd be very
>> greateful!
>
> Okey, I will make a try
>
> We assume that you have a number of pages like index.php (first page),
> news.php, admin.php, userinfo.php and so on. We continue to assume that
> index.php is accesseble for everyone, so that page don't include any
> permission check.
>
> For pages that needs permissions we have news.php, admin.php and
> userinfo.php, we assume we have three users, user_id 1, 2 and 3. All 3
> users are allowed to access the news.php, user 1 can access admin.php and
> userinfo.php while user 3 has access to userinfo.php.
>
> Then we have a table that could look like
>
> 1 news.php true
> 1 admin.php true
> 1 userinfo.php true
> 2 news.php true
> 3 news.php true
> 3 userinfo.php true
>
> The pages news.php, admin.php and userinfo.php has a simple permission
> check where they look up if the user is allowed to access the page
>
> query="SELECT perm FROM Permissions WHERE user_id=$user_id AND
> page_id='".$_SERVER['SCRIPT_NAME']."'";
>
> So if user 2 tries to access admin.php or userinfo.php, then the result
> would be "false" (you need to check how many rows the query did result in,
> 0 is false), while user 3 accessing userinfo.php would get a true.
>
>
> As I sit here and write this, the perm column isn't really needed, but can
> be used for even higher grade of permissions, like a person who has
> "false" on the perm column may not be allowed to change values, while a
> person who has "true" may change values.
>
>
> I hope you got an idea of what I'm trying to do here, if not, then just
> say what you didn't catch and I try to explain it in another way.
>
>
> //Aho

Hi J.O. Aho,

No you explained it wonderfully! I didn't understand at first how the page
permissions would work with the user permissions, but I get what you mean
now! Thank you for taking the time to explain it to me. And I'm also very
grateful for your patience, there are so many things to learn and understand
with php.

I'm going to have a go at this over the next couple of days, I'll let you
know how I get on. I may be back with other questions, if you don't mind
that is.

Have a great Sunday, and best wishes,
Linda

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация