ZODB Components: Developer Role was not returned by getRoles() for users added...
ZODB Components: Developer Role was not returned by getRoles() for users added through erp5.acl_users. It was only working if the user was only in Zope acl_users but not ERP5 acl_users because getRole() was not monkey-patch in contrary to AccessControl BasicUser.
-
Owner
It is not good to complexify getRoles: this method is called each time a restricted operation is done. IOW, about every "." in a python script calls this code implicitely.
It should be possible to instead customise user creation so that it grants the role when creating the user (EDIT: and it is actually possible, I implemented it and it passes the unittests I throw at it so far and along with a few more related changes - wow, user code is triplicated ! - speeds up noticeably), so that configuration lookup is done once per transaction and not hundreds of times.
But I do not understand the point of
elif user_id in role_set:
. Could you explain why it is here ? -
Developer
As per our discussion on Jabber, I looked into it quickly but I cannot remember why so it will take some time to investigate more. As this is it not urgent and Unit Tests are not passing as you said, I will do that after merging ba2e2a34. Ping me again if that's blocking you or if I forget though. Thanks for improving performances!