Bind File Save to user Task


I’m having some problems with the scripts when a user creates a new file in a task that wasn’t assigned to him. Can someone point me in the right direction to limit the file save so the user can’t save It in another user’s task?
Right now I’ve taken over the pipeline. I’m developing for Houdini and I’ve taken over the scene_operations hook.
I’ve changed the “hook_scene_operation” line in the “tk-multi-workfiles2.yml” file to point to my custom scene_operations script, based on the default one that ships with SG.
My first attempt was to change this part “elif operation == “save_as”:” , so the file won’t be saved if the user wasn’t assigned to the task. The user checking for the task is working fine, but I don’t know why the file still saves even if I take out the method for saving the new file.

I believe a better approach would be don’t allowing the user to even try to save the file (blocking the save button in the UI), but I don’t have a clue if It’s feasible or even how to approach It.