code: public function addWidget(ItemInterface $item)
      {
          // Check Security
          if ($this->checkRole) {
              if ($item->getRole() && !$this->security->isGranted($item->getRole())) {
                  return $this;
              }
          }
  
          // Add
          $this->widgets[$item->getId()] = $item;
  
          return $this;
      }
docs: Add Widget.
  
  @param ItemInterface $item
  
  @return $this