condition to view, edit and delete functionality