code: def fetch_action_restriction(self, reftrack, action):
          
          if action == 'import_reference' and reftrack.status() == Reftrack.UNLOADED:
              return True
          if action in ('replace', 'delete', 'import_reference') and reftrack.status() in (Reftrack.LOADED, Reftrack.UNLOADED):
                  tracknode = reftrack.get_refobj()
                  restricted = cmds.referenceQuery(tracknode, isNodeReferenced=True)
                  if restricted:
                      return True
          return super(MayaRefobjInterface, self).fetch_action_restriction(reftrack, action)
docs: Return wheter the given action is restricted for the given reftrack
  
          available actions are:
  
             ``reference``, ``load``, ``unload``, ``replace``, ``import_reference``, ``import_taskfile``, ``delete``
  
          If action is not available, True is returned.
  
          Replace and Delete is always restricted for nested references!
  
          :param reftrack: the reftrack to query
          :type reftrack: :class:`Reftrack`
          :param action: the action to check.
          :type action: str
          :returns: True, if the action is restricted
          :rtype: :class:`bool`
          :raises: None