[Vtigercrm-developers] caching user privileges

Adam Heinz amh at metricwise.net
Fri Jan 27 12:06:01 PST 2012


On creation, the user does have his permissions calculated.  The
problem is that other users don't have their privileges relative to
him recalculated.

The privilege information is already stored in the database (check out
the vtiger_role*, profile*, def_org* and datashare* tables).  The user
privilege files are simply a cache for this information.  The problem
is that the cache is expensive (slow) to regenerate and can cause
fatal errors if you make requests while it is regenerating.

On Fri, Jan 27, 2012 at 1:21 PM, Nicolas Larcipretti
<niclarcipretti at gmail.com> wrote:
> Hummm I see. I don't use sharing rules, so I didn't know that you had to do
> this every time you create a user. Maybe that could be handled just for the
> new user as you create it, instead of changing the whole system, what do you
> think? Create a recalculation just for that user, and trigger it after the
> user creation would solve the problem (and would be waaay easier to you).
>
> In fact I asked because I'm particulary annoyed with the way that Vtiger
> handles permissions. I know that this must be some Sugar remain, but,
> anytime, people will have to think about it. Wouldn't it be easier if
> instead of files, we had tables to store the privileges? And, as soon as the
> user logs into the system, we could store the privileges into the user's
> session. Going a little further, we could create some engine to keep the
> user privileges allways up to date (that would be the fun part I guess),
> cause it's reallly annoying keep asking to the user to log out and log back
> in every time we create a group or something like that.
>
> This could be a great issue to discuss. What you guys think?
>
> Cheers
>
> Nicolas
>



More information about the vtigercrm-developers mailing list