Edited task allowed function to check task details.

Needed for @marc-hanheide  and @cdondrup so please can they check.