Re: liveUser (was: Re: permissions managment)

From: Date: Tue, 13 Aug 2002 10:51:48 +0000
Subject: Re: liveUser (was: Re: permissions managment)
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-8355@lists.php.net to get a copy of this message
Am Tue, 13 Aug 2002 12:15:50 +0200 schrieb "Lukas Smith" <smith@dybnet.de>: > If I understand the class correctly it first gets all user rights and > then flattens everything. This is quite nice because it simplifies > things, since then it is much easier to handle user and group rights. > > There is just one problem with this: > It creates a lot of work to do this even though most of the time only > 1-2 rights will be requested per page load. > > Would an on demand system not be better? > This would mean it would always check the backend if the user has the > necessary rights if needed. > Obviously this would be faster if only one check was made. It might even > be faster if 2 or even 3 rights where to be requested. At some point > obviously getting everything in bulk would be faster. Hi Lukas, the class first reads all individual rights for the user and all rights he inherits from his membership in any groups. These two arrays are then merged to one array and individual rights will override group rights in the process (ie. you can have a right "make coffee" because you´re a member of the coffee group, but if your individual rights say that making coffee is specifically denied, you can´t do that :-)). This all happens at login time. After one, no request to the storage container is made throughout the entire session because all rights are stored within the user object that is stored in the session. I think the performance of this should be much higher than doing a query to the storage container every time. Regards, Markus -- *21st Media* | Consulting, Konzeption, Produktion für die Bereiche: Markus Wolff | Internet, Intranet, eCommerce, Content Management, Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming http://21st.de | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1

« previous php.pear.dev (#8355) next »