Is this generic function needed? You basically only save the check for permission == 'All'; the actual queryset filter could just be migrated in the type specific functions