Date: 07/12/01
- Next message: giancarlo pinerolo: "Re: [phplib] login page help"
- Previous message: Cresta Johnson: "Re: [phplib] login page help"
- Maybe in reply to: Zyan Mail: "[phplib] phplib individual file permission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
----- Original Message -----
From: "Zyan Mail" <ftenario <email protected>>
To: "Maxim Derkachev" <max.derkachev <email protected>>
Sent: Wednesday, July 11, 2001 4:46 PM
Subject: Re: [phplib] phplib individual file permission
> Hello Maxim,
> Thanks for the advise. But I dont think that is what we needed. Anyway, I
> was able to think of another scheme based on your example. But I have to
> modify the auth_user table and the perm.inc class. It's like extending the
> default permission scheme. I'll be posting the sample later. After I have
> done it.
>
> Thanks,
> Ferdinand
>
> ----- Original Message -----
> From: "Maxim Derkachev" <max.derkachev <email protected>>
> To: "Zyan Mail" <ftenario <email protected>>
> Cc: <phplib <email protected>>
> Sent: Wednesday, July 11, 2001 12:34 AM
> Subject: Re: [phplib] phplib individual file permission
>
>
> > Hello Ferdinand,
> >
> > Wednesday, July 11, 2001, 2:53:50 AM, you wrote:
> >
> > ZM> Hello,
> > ZM> I am using phplib just recently. Needs some advise on how to do
> permissions
> > ZM> on individual pages ( not 31 levels of permission). Any ideas on
this?
> >
> > With the current scheme you can use $perm->have_perm() to allow or
> > disallow a user to view a page according to his perms (the user's
> > permissions are global at the server). If you want to restrict access
> > to pages on individual basis (e.g. you have users joe and jim, both
> > with permission 'staff', and you want to see joe at the page, but
> > not jim), you might want to add groups. It's easily implemented.
> > E.g., additional method in Perm could be:
> >
> > function is_in_group($group) {
> > global $auth;
> > if($auth->auth['groups']) {
> > if (in_array ($group, $auth->auth['groups']) ) return true;
> > }
> > return false;
> > }
> >
> > You'd have to add means of groups definition to Auth (just like perms
> > defined), and, viola:
> > user: perm: groups:
> > joe staff array('some_page_group', ....)
> > jim staff array('another_page_group', ....)
> >
> > at some_page.php :
> > if (!$perm->is_in_group('some_page_group')) {
> > file://deny access. jim goes here
> > print "Have not enough perms";
> > die();
> > }
> > // here comes the code for allowed users. joe goes here
> >
> >
> > etc .....
> >
> >
> > --
> > Best regards,
> > Maxim Derkachev mailto:max.derkachev <email protected>
> > System administrator & programmer,
> > Symbol-Plus Publishing Ltd.
> > phone: +7 (812) 324-53-53
> > www.books.ru, www.symbol.ru
> >
> >
>
-- Abbestellen mit Mail an: phplib-unsubscribe <email protected> Kommandoliste mit Mail an: phplib-help <email protected>
- Next message: giancarlo pinerolo: "Re: [phplib] login page help"
- Previous message: Cresta Johnson: "Re: [phplib] login page help"
- Maybe in reply to: Zyan Mail: "[phplib] phplib individual file permission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

