[Vtigercrm-developers] caching user privileges

Adam Heinz amh at metricwise.net
Wed Mar 14 12:43:22 PDT 2012


Second ticket entered!  http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7379

So I've pulled out the bulk of user_privileges.php -- and learned a
lot in the process. If you look at the SQL I wrote, you'll see an
excessive number of joins against vtiger_user2role. Not great. I think
the solution to this is to create a first class Roles object that
encapsulates and caches role data, which I plan to do on my next pass
at this.

The majority of the functions in UserInfoUtil should have a dependency
inversion refactoring done to them and be moved into the main Users
and Roles classes. I think that the contents of UserPrivileges should
also be split between Users and Roles. At its core, I think that
calling $user->getPrivileges()->getSubordinateRoles() is less
intuitive than $user->getRole()->getSubordinateRoles().

Anyway, reality has caught up with me and I must return to more
traditional duties. Tune in next week, same vtiger time, same vtiger
channel!



More information about the vtigercrm-developers mailing list