code: def staff_member(view_func):
      
  
      @functools.wraps(view_func, assigned=available_attrs(view_func))
      def dec(request, *args, **kwargs):
          if request.user.is_staff:
              return view_func(request, *args, **kwargs)
          raise PermissionDenied(_("You haven't permissions to do this action."))
      return dec
docs: Performs user authentication check.
  
      Similar to Django's `login_required` decorator, except that this throws
      :exc:`~leonardo.exceptions.NotAuthenticated` exception if the user is not
      signed-in.