Restrict user access based on the status of task

I want to restrict non-admin users from listview the tasks which have a status of “Delivered” in them. I tried using role based access but it only seems to provide owner bases filtering. It would be great, if it is possible to go one step further and restrict non-admin users having anysort of access anywhere to tasks with “Delivered” status but my main motive is to block them in the listview. How can I do this?

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

Thanks,

BrozTechnologies

By ListView formatting I am only able to format the fields on a row, but for my purpose I wanna hide the entire row depending on the status field value. How can I achieve that?

You need to modify the query on the custom/YOURMODULE/views/view.list.php and extend the query with

$this->params[‘custom_where’] = " YOUR CUSTOM WHERE HERE"

Check this sample for more info:

Thanks,

BrozTechnologies

thank you it’s working for the list view. but how can I prevent users from being able to edit the closed task or detail view using the URL of the task?

You should open another post for that one. The original question seems to be solved already.

Thanks,

BrozTechnologies

I’ve created a new post here Prevent user access to all endpoints based on the status of task