code: def admin_required(group):
      
  
      def in_admin_group(user):
          return user.is_authenticated and user.has_admin_permission(group)
  
      return user_passes_test(in_admin_group)
docs: Decorator that requires the user to be in a certain admin group.
  
      For example, @admin_required("polls") would check whether a user is
      in the "admin_polls" group or in the "admin_all" group.