Re: [phplib] permissions again... From: Michael R. Tuzi (mrtuzi <email protected>)
Date: 06/24/00

When you first installed phplib, permissions for a given page were
defined by the perm->check("perm_required_for_this_page"). The value of
perm_required_for_this_page was then compared to the users perms value
stored in the auth_user table. The $permissions array was set up in
local.inc as follows:

  var $permissions = array(
                           "user" => 1,
                           "author" => 2,
                           "editor" => 4,
                           "supervisor" => 8,
                           "admin" => 16
                           );
Here, only an editor can access a page that checked for "editor," but no
other type. An alternative assignment documented, shows the following
$permissions array:

  var $permissions = array("user" => 1,
                           "author" => 3,
                           "editor" => 7,
                           "supervisor" => 15,
                           "admin" => 31
                           );

Here, an editor can access editor, author, and user pages. If you desire
to make changes on the fly, you could always change a users permissions
in the auth_user page, although I don't believe this to be the best
approach.

See http://phplib.netuse.de/documentation/documentation-3.html#ss3.2

Hope this helps.

Michael

Marius ANDREIANA wrote:
>
> Hi
>
> Well, got carried away with discussion and forgot the main point :)
>
> I want the Perm class to :
> * store the permissions as array text => numeric (current : yes)
> * store the permissions in variable $perms as numeric
> (current : stored in Auth)
> I want this because it would be nice for the Perm class to be
> independent. Example of use : a member, with editor permission,
> want to give to another member the permission author.
> $p = new Perm;
> $p->set_from_text($text_perms);
> $p->set_perm("author");
> $text_perms = $p->get_text();
>
> * get/set a permission, with functions like
> set_perm("author"); //current : no ?
> has_perm("author"); //current : yes
>
> * When authentificating the user (e.g. in Example_Auth, validate_login())
> use the global variable $perm to store the permissions in the $perm class
> (if it's the case).
>
> Please let me know what do you think, what else should be done.
> I use permissions a lot and if this code will be merged in
> PHPLIB it will be very helpful.
>
> Marius
>
> --
> Your mouse has moved. In order for the change to take effect,
> Windows must be restarted. Reboot now ? [OK]
> http://lug.ro/ldir
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>