docstr: Enable/Disable Registration for Data Scientist or Guest Users.
docstr_tok: ["Enable\/Disable","Registration","for","Data","Scientist","or","Guest","Users","."]
code: def allow_guest_signup(
      self, context: AuthedServiceContext, enable: bool
  ) -> Union[SyftSuccess, SyftError]:
      """Enable/Disable Registration for Data Scientist or Guest Users."""
      flags.CAN_REGISTER = enable
      method = context.node.get_service_method(SettingsService.update)
      settings = NodeSettingsUpdate(signup_enabled=enable)
  
      result = method(context=context, settings=settings)
  
      if result.is_err():
          return SyftError(
              message=f"Failed to update settings: {result.err()}"
          )
  
      message = "enabled" if enable else "disabled"
      return SyftSuccess(
          message=f"Registration feature successfully {message}"
      )
  
imports: from typing import Union
  from result import Err
  from result import Ok
  from result import Result
  from ...serde.serializable import serializable
  from ...store.document_store import DocumentStore
  from ...util.experimental_flags import flags
  from ..context import AuthedServiceContext
  from ..context import UnauthedServiceContext
  from ..response import SyftError
  from ..response import SyftSuccess
  from ..service import AbstractService
  from ..service import service_method
  from ..warnings import HighSideCRUDWarning
  from .settings import NodeSettingsUpdate
  from .settings import NodeSettingsV2
  from .settings_stash import SettingsStash
label_desc: Use image node_id 5 for calling the SettingsService obj's underlying member method code with example usage: obj.allow_guest_signup(context, enable) and returns: SyftSuccess, SyftError