def METHOD_NAME(self, request, view):
    task_id = view.kwargs["task_id"]
    task_resources = res_factory.resources_for_task(task_id)
    allow_or_raise_auth_failed(
        iam=iam,
        system=IAMMeta.SYSTEM_ID,
        subject=Subject("user", request.user.username),
        action=Action(IAMMeta.TASK_EDIT_ACTION),
        resources=task_resources,
    )
    return True