code: def check_permission(self, request):
      if not self.ds.setting("allow_signed_tokens"):
          raise Forbidden(
              "Signed tokens are not enabled for this Datasette instance"
          )
      if not request.actor:
          raise Forbidden("You must be logged in to create a token")
      if not request.actor.get("id"):
          raise Forbidden(
              "You must be logged in as an actor with an ID to create a token"
          )
      if request.actor.get("token"):
          raise Forbidden(
              "Token authentication cannot be used to create additional tokens"
          )
  
imports: import json
  from datasette.utils.asgi import Response, Forbidden
  from datasette.utils import actor_matches_allow, add_cors_headers, tilde_encode, tilde_decode
  from .base import BaseView, View
  import secrets
  import urllib
label_desc: Use image node_id 1 for calling the CreateTokenView obj's underlying member method code with example usage: obj.check_permission(request) without return types