Re: [Phplib-users] handle perm in auth
Brought to you by:
nhruby,
richardarcher
From: Joe S. <jo...@be...> - 2002-10-10 17:16:15
|
To keep the conversation going... On Wed, Oct 09, 2002 at 09:57:15PM -0400, Rob Hutton wrote: > I think you are trying to fit a square peg in a round hole. That kind of > bitwise math is too complex to reasonably maintain for the average db admin. > IMHO it would be better to have a user_perms table like: > > uid > permname > permlevel > You should be able to generate the permissions array from a db if needed. The example in local.inc is just that, and example. > Then it would be easy to see in the db what perms are set and still fits in > with the current scheme. > I don't want to be tied to a db for each perm check. I agree that using binary arithmetic to generate individual permissions causes problems. Give the permx.class a try. Applied to the atomic permissions example in local.inc the permissions array would look like: var $permissions = array( "user" => true, "author" => true, "editor" => true, "supervisor" => true, "admin" => true ); The permx.class is in the patches snapshot and here: http://sourceforge.net/tracker/index.php?func=detail&aid=617072&group_id=31885&atid=403613 It's been posted for everyone's feedback and ridicule. Joe > Rob Hutton > Web Safe > www.wsafe.com > |