code: def check_cups_allowed(func):
      
      @wraps(func)
      def decorator(*args, **kwargs):
          cups = kwargs.get('cups')
          if (cups and current_user.is_authenticated()
                  and not current_user.allowed(cups, 'cups')):
              return current_app.login_manager.unauthorized()
          return func(*args, **kwargs)
      return decorator
docs: Check if CUPS is allowd by token