• Vincent Pelletier's avatar
    {,Propertied}User: Reduce the overhead from Developer role processing. · 3b3c65b2
    Vincent Pelletier authored
    getRoles is called a lot (on every restricted access, so hundreds of times
    per transaction), it is definitely not the right place to do extra
    computation, especially when their result does not change from one call
    to the next (configuration should only change on process restart, so not
    during a transaction - and even if it someday did, it should be fine to
    wait for next transaction for it to take effect).
    Instead, do the extra work when creating the user (typically once per
    transaction).
    Also, modernise python syntax (simplifications & style).
    Also, reduce code duplication from ERP5Security.ERP5UserFactory.
    3b3c65b2
ERP5UserFactory.py 4.61 KB