new_contents: from functools import wraps
  
  from corehq.apps.accounting.utils.subscription import get_account_or_404
  
  
  def require_enterprise_admin(view_func):
      @wraps(view_func)
      def _inner(request, domain, *args, **kwargs):
          # todo separate authorization from get method
          request.account = get_account_or_404(request, domain)
          return view_func(request, domain, *args, **kwargs)
      return _inner
  
subject: add permissions check decorator for enterprise views todo: apply to other enterprise views in a followup PR