code: def permission_required(perm, login_url=None):
      
  
      return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url)
docs: Replacement for django.contrib.auth.decorators.permission_required that
      returns 403 Forbidden if the user is already logged in.