Change List View of a doctype based on role

I added filter to list view in Task same as Todo list.
But the filter should be different as per the role.
Manager role can view everything but other users while viewing task list should be filtered by ‘Assigned to them’
Can this be done?

Not out of the box. You will have to check the user role and then apply the filter in the todo_list.js
Also if you edit the source code for such type of customizations your updates will break.

Would recommend to manage this using permissions instead.

ok neil