code: def guard_assign(analysis):
      
      # Only if the request was done from worksheet context.
      if not is_worksheet_context():
          return False
  
      # Cannot assign if the Sample has not been received
      if not analysis.isSampleReceived():
          return False
  
      # Cannot assign if the analysis has a worksheet assigned already
      if analysis.getWorksheet():
          return False
  
      # Cannot assign if user does not have permissions to manage worksheets
      return user_can_manage_worksheets()
docs: Return whether the transition "assign" can be performed or not