On pe, 28 elo 2020, Ruslan Skira via FreeIPA-users wrote:
Hello, guys could please clarify and help me I need to add
pre_callback
fo user_disable function. But this object does not have such methods.
But user_delete has. How I should add my extra logic to this method?
Since user_disable class is built on top of LDAPQuery and that one is on
top of BaseLDAPCommand, it also has support for pre/post callbacks.
Unfortunately, user_disable.exec() doesn't use any of the callbacks at
all and does run ldap.deactivate_entry() directly.
This means no callback can be called.
Right now, the only way to get around it is to redefine
user_disable.exec() in your plugin.
A patch that adds support for callbacks in
user_disable/user_enable/user_status, similar to how it is implemented
in LDAPRetrieve class is welcome. You might need to adopt the signatures
of the callback methods to be reasonable for theese commands, of course.
--
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland