Restrict user access based on the status of task

I think a combination of these two samples should help you to achieve your goal:

Thanks,

BrozTechnologies