code: def user_can_edit_newsitem(user, NewsItem):
      
      for perm in format_perms(NewsItem, ['add', 'change', 'delete']):
          if user.has_perm(perm):
              return True
  
      return False
docs: Check if the user has permission to edit a particular NewsItem type.